knitr::opts_chunk$set(echo = FALSE)
needed_packages <- c("VIM", "tidyverse","pastecs", "ggplot2", "semTools", "psych", "FSA", "car", "effectsize", "coin", "rstatix", "sjstats", "userfriendlyscience", "stats", "foreign", "gmodels", "lm.beta","stargazer", "lmtest", "DescTools", "nnet", "reshape2", "generalhoslem", "Epi", "arm", "regclass", "olsrr","REdaS", "Hmisc","corrplot","ggcorrplot", "factoextra", "nFactors")   

# Extract not installed packages
not_installed <- needed_packages[!(needed_packages %in% installed.packages()[, "Package"])]    
# Install not installed packages
if(length(not_installed)) 
  install.packages(not_installed) 

library(pastecs) #For creating descriptive statistic summaries
library(ggplot2) #For creating histograms with more detail than plot
library(semTools) #For skewness and kurtosis
## Loading required package: lavaan
## This is lavaan 0.6-7
## lavaan is BETA software! Please report any bugs.
## 
## ###############################################################################
## This is semTools 0.5-3
## All users of R (or SEM) are invited to submit functions or ideas for functions.
## ###############################################################################
library(psych)  #For descriptive functions
## 
## Attaching package: 'psych'
## The following object is masked from 'package:semTools':
## 
##     skew
## The following object is masked from 'package:lavaan':
## 
##     cor2cov
## The following objects are masked from 'package:ggplot2':
## 
##     %+%, alpha
library(FSA) #For percentage
## ## FSA v0.8.30. See citation('FSA') if used in publication.
## ## Run fishR() for related website and fishR('IFAR') for related book.
## 
## Attaching package: 'FSA'
## The following object is masked from 'package:psych':
## 
##     headtail
library(car) # For Levene's test for homogeneity of variance and  test for colinearity of predictors
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:FSA':
## 
##     bootCase
## The following object is masked from 'package:psych':
## 
##     logit
library(effectsize) #To calculate effect size for t-test
## 
## Attaching package: 'effectsize'
## The following object is masked from 'package:psych':
## 
##     phi
library(VIM)
## Loading required package: colorspace
## Loading required package: grid
## VIM is ready to use.
## Suggestions and bug-reports can be submitted at: https://github.com/statistikat/VIM/issues
## 
## Attaching package: 'VIM'
## The following object is masked from 'package:datasets':
## 
##     sleep
library(tidyverse)
## ── Attaching packages ───────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ tibble  3.0.3     ✓ dplyr   1.0.2
## ✓ tidyr   1.1.2     ✓ stringr 1.4.0
## ✓ readr   1.3.1     ✓ forcats 0.5.0
## ✓ purrr   0.3.4
## ── Conflicts ──────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## x psych::%+%()       masks ggplot2::%+%()
## x psych::alpha()     masks ggplot2::alpha()
## x readr::clipboard() masks semTools::clipboard()
## x tidyr::extract()   masks pastecs::extract()
## x dplyr::filter()    masks stats::filter()
## x dplyr::first()     masks pastecs::first()
## x dplyr::lag()       masks stats::lag()
## x dplyr::last()      masks pastecs::last()
## x dplyr::recode()    masks car::recode()
## x purrr::some()      masks car::some()
library(coin) # For Wilcox test (non-parametric)
## Loading required package: survival
library(rstatix) # For calculating effect size
## 
## Attaching package: 'rstatix'
## The following objects are masked from 'package:coin':
## 
##     chisq_test, friedman_test, kruskal_test, sign_test, wilcox_test
## The following objects are masked from 'package:effectsize':
## 
##     cohens_d, eta_squared
## The following object is masked from 'package:stats':
## 
##     filter
library(sjstats) #calculate effect size for t-test
## Registered S3 methods overwritten by 'lme4':
##   method                          from
##   cooks.distance.influence.merMod car 
##   influence.merMod                car 
##   dfbeta.influence.merMod         car 
##   dfbetas.influence.merMod        car
## 
## Attaching package: 'sjstats'
## The following objects are masked from 'package:effectsize':
## 
##     cohens_f, phi
## The following object is masked from 'package:FSA':
## 
##     se
## The following object is masked from 'package:psych':
## 
##     phi
library(userfriendlyscience)
## Registered S3 method overwritten by 'GGally':
##   method from   
##   +.gg   ggplot2
## Registered S3 methods overwritten by 'ufs':
##   method                     from               
##   grid.draw.ggProportionPlot userfriendlyscience
##   pander.associationMatrix   userfriendlyscience
##   pander.dataShape           userfriendlyscience
##   pander.descr               userfriendlyscience
##   pander.normalityAssessment userfriendlyscience
##   print.CramersV             userfriendlyscience
##   print.associationMatrix    userfriendlyscience
##   print.confIntOmegaSq       userfriendlyscience
##   print.confIntV             userfriendlyscience
##   print.dataShape            userfriendlyscience
##   print.descr                userfriendlyscience
##   print.ggProportionPlot     userfriendlyscience
##   print.meanConfInt          userfriendlyscience
##   print.multiVarFreq         userfriendlyscience
##   print.normalityAssessment  userfriendlyscience
##   print.regrInfluential      userfriendlyscience
##   print.scaleDiagnosis       userfriendlyscience
##   print.scaleStructure       userfriendlyscience
##   print.scatterMatrix        userfriendlyscience
## 
## Attaching package: 'userfriendlyscience'
## The following objects are masked from 'package:FSA':
## 
##     is.even, is.odd
## The following object is masked from 'package:semTools':
## 
##     reliability
library(stats)
library(foreign) # open SPSS file, I may not use that.
library(gmodels) #For creating histograms with more detail than plot
## 
## Attaching package: 'gmodels'
## The following object is masked from 'package:sjstats':
## 
##     ci
library(stargazer)#For formatting outputs/tables for regression
## 
## Please cite as:
##  Hlavac, Marek (2018). stargazer: Well-Formatted Regression and Summary Statistics Tables.
##  R package version 5.2.2. https://CRAN.R-project.org/package=stargazer
library(lm.beta) # to isolate the beta co-efficients for regression

#Multinomial regression
library(lmtest)
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
library(DescTools)
## Registered S3 method overwritten by 'DescTools':
##   method         from 
##   reorder.factor gdata
## 
## Attaching package: 'DescTools'
## The following object is masked from 'package:car':
## 
##     Recode
## The following objects are masked from 'package:psych':
## 
##     AUC, ICC, SD
library(nnet) #Multinomial regression
library(reshape2)
## 
## Attaching package: 'reshape2'
## The following object is masked from 'package:tidyr':
## 
##     smiths
library(generalhoslem) #For test of fit for logistic regression, test assumption of linearity
## Loading required package: reshape
## 
## Attaching package: 'reshape'
## The following objects are masked from 'package:reshape2':
## 
##     colsplit, melt, recast
## The following object is masked from 'package:dplyr':
## 
##     rename
## The following objects are masked from 'package:tidyr':
## 
##     expand, smiths
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## The following object is masked from 'package:rstatix':
## 
##     select
## The following object is masked from 'package:dplyr':
## 
##     select
library(Epi) #ROC Curve
library(arm) #for invlogit calculating predicted probabilities
## Loading required package: Matrix
## 
## Attaching package: 'Matrix'
## The following object is masked from 'package:reshape':
## 
##     expand
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
## Loading required package: lme4
## 
## Attaching package: 'lme4'
## The following object is masked from 'package:Epi':
## 
##     factorize
## The following object is masked from 'package:userfriendlyscience':
## 
##     getData
## 
## arm (Version 1.11-2, built: 2020-7-27)
## Working directory is /home/d19125334/Documents/PhD_Modules_2021/ProbilityandStatisiticInference/assignment/assignment1/Assignment1
## 
## Attaching package: 'arm'
## The following object is masked from 'package:effectsize':
## 
##     standardize
## The following object is masked from 'package:car':
## 
##     logit
## The following objects are masked from 'package:psych':
## 
##     logit, rescale, sim
library(regclass) #For confusion matrix
## Loading required package: bestglm
## Loading required package: leaps
## Loading required package: VGAM
## Loading required package: stats4
## Loading required package: splines
## 
## Attaching package: 'VGAM'
## The following object is masked from 'package:arm':
## 
##     logit
## The following object is masked from 'package:lmtest':
## 
##     lrtest
## The following object is masked from 'package:tidyr':
## 
##     fill
## The following object is masked from 'package:VIM':
## 
##     wine
## The following object is masked from 'package:car':
## 
##     logit
## The following objects are masked from 'package:psych':
## 
##     fisherz, logistic, logit
## Loading required package: rpart
## Loading required package: randomForest
## randomForest 4.6-14
## Type rfNews() to see new features/changes/bug fixes.
## 
## Attaching package: 'randomForest'
## The following object is masked from 'package:dplyr':
## 
##     combine
## The following object is masked from 'package:psych':
## 
##     outlier
## The following object is masked from 'package:ggplot2':
## 
##     margin
## Important regclass change from 1.3:
## All functions that had a . in the name now have an _
## all.correlations -> all_correlations, cor.demo -> cor_demo, etc.
## 
## Attaching package: 'regclass'
## The following object is masked from 'package:DescTools':
## 
##     VIF
library(olsrr)
## 
## Attaching package: 'olsrr'
## The following object is masked from 'package:MASS':
## 
##     cement
## The following object is masked from 'package:datasets':
## 
##     rivers
#Dimension Reduction
library(REdaS)
library(Hmisc)
## Loading required package: lattice
## 
## Attaching package: 'lattice'
## The following object is masked from 'package:regclass':
## 
##     qq
## The following object is masked from 'package:userfriendlyscience':
## 
##     oneway
## Loading required package: Formula
## 
## Attaching package: 'Hmisc'
## The following objects are masked from 'package:DescTools':
## 
##     %nin%, Label, Mean, Quantile
## The following object is masked from 'package:userfriendlyscience':
## 
##     escapeRegex
## The following objects are masked from 'package:dplyr':
## 
##     src, summarize
## The following object is masked from 'package:psych':
## 
##     describe
## The following objects are masked from 'package:base':
## 
##     format.pval, units
library(corrplot)
## corrplot 0.84 loaded
## 
## Attaching package: 'corrplot'
## The following object is masked from 'package:arm':
## 
##     corrplot
library(ggcorrplot)
## 
## Attaching package: 'ggcorrplot'
## The following object is masked from 'package:rstatix':
## 
##     cor_pmat
library(factoextra) #Used for principal component analysis to get a different view of eigenvalues
## Welcome! Want to learn more? See two factoextra-related books at https://goo.gl/ve3WBa
library(nFactors)
## 
## Attaching package: 'nFactors'
## The following object is masked from 'package:lattice':
## 
##     parallel
#getwd()

stdMathData=read.table("student-mat.csv",sep=";",header=TRUE)
stdPorlagData=read.table("student-por.csv",sep=";",header=TRUE)

stdMergeData=merge(stdMathData,stdPorlagData,by=c("school","sex","age","address","famsize","Pstatus","Medu","Fedu","Mjob","Fjob","reason","nursery","internet"))

colnames(stdMathData) <- tolower(colnames(stdMathData))
colnames(stdPorlagData) <- tolower(colnames(stdPorlagData))
colnames(stdMergeData) <- tolower(colnames(stdMergeData))

Linear Regression

Build Linear Regression Model

#G1 and G2  for math course with paid (yes, no)
# G2 is predicted by g1 including dummy variable for paid that extra paid classes within the Math course to investigate a differential effect by paid. 
# Descriptives and visuals for g1 (first period grade)
gg_g1 <- ggplot(stdMathData, aes(x=g1)) +
         labs(x="Normalised first period grade (g1)") +
         ggtitle("Figure 1 - Histogram for Normalised first period grade of Math") +
         geom_histogram(binwidth=2, colour="black", aes(y=..density.., fill=..count..)) +
         scale_fill_gradient("Count", low="#DCDCDC", high="#7C7C7C") + 
         stat_function(fun=dnorm, color="red",args=list(mean=mean(stdMathData$g1, na.rm=TRUE), sd=sd(stdMathData$g1, na.rm=TRUE)))

gg_g1

qqnorm(stdMathData$g1, main="Figure 2 - QQ Plot for Normalised First period grade of Math")
qqline(stdMathData$g1, col=2)

# statistics descpritve
#g1 generae summary statistics
pastecs::stat.desc(stdMathData$g1, basic=F)
##       median         mean      SE.mean CI.mean.0.95          var      std.dev 
##   11.0000000   10.9088608    0.1670068    0.3283359   11.0170533    3.3191947 
##     coef.var 
##    0.3042659
#skewness and kurtosis
tpskew <- semTools::skew(stdMathData$g1)
tpkurt <- semTools::kurtosis(stdMathData$g1)


tpskew[1]/tpskew[2]
## skew (g1) 
##  1.952282
tpkurt[1]/tpkurt[2]
## Excess Kur (g2) 
##       -2.814788
mathg1<- abs(scale(stdMathData$g1))
FSA::perc(as.numeric(mathg1), 1.96, "gt")
## [1] 3.291139
FSA::perc(as.numeric(mathg1), 3.29, "gt")
## [1] 0
length(stdMathData$g1)
## [1] 395
# Descriptives and visuals for g2 (second period grade) ---- predicted
gg_g2 <- ggplot(stdMathData, aes(x=g2)) +
         labs(x="Normalised Second period grade") +
         ggtitle("Figure 3 - Histogram for Normalised second period grade of Math") +
         geom_histogram(binwidth=2, colour="black", aes(y=..density.., fill=..count..)) +
         scale_fill_gradient("Count", low="#DCDCDC", high="#7C7C7C") + 
         stat_function(fun=dnorm, color="red",args=list(mean=mean(stdMathData$g2, na.rm=TRUE), sd=sd(stdMathData$g2, na.rm=TRUE)))

gg_g2

qqnorm(stdMathData$g2, main="Figure 4 - QQ Plot for Normalised second period grade of Math")
qqline(stdMathData$g2, col=2)

# statistics descpritve
#g2 generate summary statistics
pastecs::stat.desc(stdMathData$g2, basic=F)
##       median         mean      SE.mean CI.mean.0.95          var      std.dev 
##   11.0000000   10.7139241    0.1892618    0.3720894   14.1489173    3.7615047 
##     coef.var 
##    0.3510856
#skewness and kurtosis
tpskew <- semTools::skew(stdMathData$g2)
tpkurt <- semTools::kurtosis(stdMathData$g2)

tpskew[1]/tpskew[2]
## skew (g1) 
## -3.502273
tpkurt[1]/tpkurt[2]
## Excess Kur (g2) 
##        2.546531
mathg2<- abs(scale(stdMathData$g2))
FSA::perc(as.numeric(mathg2), 1.96, "gt")
## [1] 4.050633
FSA::perc(as.numeric(mathg2), 3.29, "gt")
## [1] 0
length(stdMathData$g2)
## [1] 395
# Explore relationship between g1 and g2
#show scatterplot of second period grade (g2)  (y) and the first period grade (g1) (x)

scat_g2g1 <- ggplot2::ggplot(stdMathData, aes(g1, g2))
#Add a regression line
scat_g2g1 + geom_point() + geom_smooth(method = "lm", colour = "Red", se = F) + labs(x = "1st Period Grade for Math course", y = "Normalised 2nd Period Grade for Math course") 
## `geom_smooth()` using formula 'y ~ x'

#Pearson Correlation
stats::cor.test(stdMathData$g1, stdMathData$g2, method='pearson')
## 
##  Pearson's product-moment correlation
## 
## data:  stdMathData$g1 and stdMathData$g2
## t = 32.278, df = 393, p-value < 2.2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.8226117 0.8770475
## sample estimates:
##       cor 
## 0.8521181
# simple linear regression -> g2 predicted by g1
model_g1g2 <- lm(stdMathData$g2 ~ stdMathData$g1)
anova(model_g1g2)
## Analysis of Variance Table
## 
## Response: stdMathData$g2
##                 Df Sum Sq Mean Sq F value    Pr(>F)    
## stdMathData$g1   1 4047.8  4047.8  1041.9 < 2.2e-16 ***
## Residuals      393 1526.9     3.9                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("\n *******Summary Model_g1g2*******\n") 
## 
##  *******Summary Model_g1g2*******
summary(model_g1g2)
## 
## Call:
## lm(formula = stdMathData$g2 ~ stdMathData$g1)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -11.7676  -0.8363   0.1637   1.1637   4.1981 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     0.17957    0.34110   0.526    0.599    
## stdMathData$g1  0.96567    0.02992  32.278   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.971 on 393 degrees of freedom
## Multiple R-squared:  0.7261, Adjusted R-squared:  0.7254 
## F-statistic:  1042 on 1 and 393 DF,  p-value: < 2.2e-16
lm.beta::lm.beta(model_g1g2)
## 
## Call:
## lm(formula = stdMathData$g2 ~ stdMathData$g1)
## 
## Standardized Coefficients::
##    (Intercept) stdMathData$g1 
##      0.0000000      0.8521181
stargazer(model_g1g2, type="text") #Tidy output of all the required stats
## 
## ===============================================
##                         Dependent variable:    
##                     ---------------------------
##                                 g2             
## -----------------------------------------------
## g1                           0.966***          
##                               (0.030)          
##                                                
## Constant                       0.180           
##                               (0.341)          
##                                                
## -----------------------------------------------
## Observations                    395            
## R2                             0.726           
## Adjusted R2                    0.725           
## Residual Std. Error      1.971 (df = 393)      
## F Statistic         1,041.857*** (df = 1; 393) 
## ===============================================
## Note:               *p<0.1; **p<0.05; ***p<0.01
# add paid: extra paid classes within the course subject (Math or Portuguese) (binary: yes or no)
# paid as dummy variable 
model_g1g2p <- lm(stdMathData$g2 ~ stdMathData$g1 + stdMathData$paid)
anova(model_g1g2p)
## Analysis of Variance Table
## 
## Response: stdMathData$g2
##                   Df Sum Sq Mean Sq   F value  Pr(>F)    
## stdMathData$g1     1 4047.8  4047.8 1059.2284 < 2e-16 ***
## stdMathData$paid   1   28.9    28.9    7.5525 0.00627 ** 
## Residuals        392 1498.0     3.8                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("\n *******Summary Model_g1g2p*******\n") 
## 
##  *******Summary Model_g1g2p*******
summary(model_g1g2p)
## 
## Call:
## lm(formula = stdMathData$g2 ~ stdMathData$g1 + stdMathData$paid)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -11.5153  -0.7405   0.0168   0.9605   4.4471 
## 
## Coefficients:
##                     Estimate Std. Error t value Pr(>|t|)    
## (Intercept)         -0.03443    0.34714  -0.099  0.92104    
## stdMathData$g1       0.96248    0.02969  32.414  < 2e-16 ***
## stdMathData$paidyes  0.54293    0.19756   2.748  0.00627 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.955 on 392 degrees of freedom
## Multiple R-squared:  0.7313, Adjusted R-squared:  0.7299 
## F-statistic: 533.4 on 2 and 392 DF,  p-value: < 2.2e-16
lm.beta::lm.beta(model_g1g2p)
## 
## Call:
## lm(formula = stdMathData$g2 ~ stdMathData$g1 + stdMathData$paid)
## 
## Standardized Coefficients::
##         (Intercept)      stdMathData$g1 stdMathData$paidyes 
##          0.00000000          0.84930404          0.07200818
stargazer(model_g1g2p, type="text")
## 
## ===============================================
##                         Dependent variable:    
##                     ---------------------------
##                                 g2             
## -----------------------------------------------
## g1                           0.962***          
##                               (0.030)          
##                                                
## paidyes                      0.543***          
##                               (0.198)          
##                                                
## Constant                      -0.034           
##                               (0.347)          
##                                                
## -----------------------------------------------
## Observations                    395            
## R2                             0.731           
## Adjusted R2                    0.730           
## Residual Std. Error      1.955 (df = 392)      
## F Statistic          533.390*** (df = 2; 392)  
## ===============================================
## Note:               *p<0.1; **p<0.05; ***p<0.01

Linear Model Assumptions

#Influential Outliers - Cook's distance
cooksd_modelg1g2p<-sort(cooks.distance(model_g1g2p))

# plot Cook's distance
plot(cooksd_modelg1g2p, pch="*", cex=2, main="Influential Observations by Cooks distance")  
abline(h = 4*mean(cooksd_modelg1g2p, na.rm=T), col="red")  # add cutoff line
# add labels
text(x=1:length(cooksd_modelg1g2p)+1, y=cooksd_modelg1g2p, labels=ifelse(cooksd_modelg1g2p>4*mean(cooksd_modelg1g2p, na.rm=T),names(cooksd_modelg1g2p),""), col="blue")  

influential <- as.numeric(names(cooksd_modelg1g2p)[(cooksd_modelg1g2p > 4*mean(cooksd_modelg1g2p, na.rm=T))])  # influential row numbers
stem(influential)
## 
##   The decimal point is 2 digit(s) to the right of the |
## 
##   0 | 1
##   1 | 334444556667
##   2 | 4567
##   3 | 3
head(stdMathData[influential, ])  # influential observations.
##     school sex age address famsize pstatus medu fedu  mjob     fjob     reason
## 255     GP   M  17       R     GT3       T    2    1 other    other     course
## 157     GP   M  17       R     LE3       T    1    2 other    other reputation
## 165     GP   M  17       R     LE3       T    1    1 other services     course
## 5       GP   F  16       U     GT3       T    3    3 other    other       home
## 162     GP   M  15       R     GT3       T    3    2 other    other     course
## 138     GP   F  16       U     GT3       A    3    3 other    other     course
##     guardian traveltime studytime failures schoolsup famsup paid activities
## 255   mother          1         1        0        no     no   no         no
## 157   mother          1         1        0        no     no   no         no
## 165   mother          4         2        3        no     no   no        yes
## 5     father          1         2        0        no    yes  yes         no
## 162   mother          2         2        2       yes    yes   no         no
## 138    other          2         1        2        no    yes   no        yes
##     nursery higher internet romantic famrel freetime goout dalc walc health
## 255      no    yes      yes       no      4        4     2    2    4      5
## 157     yes    yes       no       no      2        2     2    3    3      5
## 165     yes     no       no      yes      5        3     5    1    5      5
## 5       yes    yes       no       no      4        3     2    1    2      5
## 162     yes    yes      yes      yes      4        4     4    1    4      3
## 138      no    yes      yes      yes      4        3     2    1    1      5
##     absences g1 g2 g3
## 255        0  8 12 12
## 157        8 16 12 13
## 165        0  5  8  7
## 5          4  6 10 10
## 162        6  5  9  7
## 138        0  4  0  0
cat("\n *******influential observations - the values of g1*******\n") 
## 
##  *******influential observations - the values of g1*******
head(stdMathData[influential, ]$g1)
## [1]  8 16  5  6  5  4
cat("\n *******influential observations - the values of g2*******\n") 
## 
##  *******influential observations - the values of g2*******
head(stdMathData[influential, ]$g2)
## [1] 12 12  8 10  9  0
cat("\n *******influential observations - the values of paid*******\n") 
## 
##  *******influential observations - the values of paid*******
head(stdMathData[influential, ]$paid)
## [1] "no"  "no"  "no"  "yes" "no"  "no"
car::outlierTest(model_g1g2p) # Bonferonni p-value for most extreme obs, looking for any cases where the outcome variable has an unusual variable for its predictor values.
##      rstudent unadjusted p-value Bonferroni p
## 131 -6.179178         1.6196e-09   6.3973e-07
## 136 -5.617932         3.6756e-08   1.4519e-05
## 137 -5.070408         6.1409e-07   2.4257e-04
## 135 -4.534650         7.6834e-06   3.0349e-03
## 132 -4.008873         7.3075e-05   2.8865e-02
car::leveragePlots(model_g1g2p) # leverage plots

plot(model_g1g2p, 1)

plot(model_g1g2p, 3)

The first plot is the chart of residuals vs fitted values, in the second plot the standardised residuals are on the Y axis. If there is absolutely no heteroscedastity, you should see a completely random, equal distribution of points throughout the range of X axis and a flat red line. I expect to see that there is no pattern in the residuals and that they are equally spread around the y = 0 line - the dashed line.
in this case, as the red line is slightly distorted in the middle on first plot but is not a big problem. Looking at the second plot we can see that while it is a problem it is not huge. Only a concern if there are definite patterns.
#Create histogram and  density plot of the residuals
plot(density(resid(model_g1g2p))) 

#Create a QQ plotqqPlot(model, main="QQ Plot") #qq plot for Standardised residuals 
car::qqPlot(model_g1g2p, main="QQ Plot")

## [1] 131 136
## 
##  ****** Calculate Collinearity ******
##   stdMathData$g1 stdMathData$paid 
##          1.00153          1.00153
## 
##  ****** Calculate tolerance ******
##   stdMathData$g1 stdMathData$paid 
##        0.9984728        0.9984728
Report Linear Model:


A multiple regression was carried out to investigate whether first period grades of Math course and extra paid classes within the course subject could significantly predict participants’ second period grades. second period grades of the histogram, normal QQ plot of standardised residuals and the scatterplot of the dependent variable, second period grades and the standardised residuals showed that the some outliers existed. 
However, second period grades of the standardised residuals showed that could be considered to have undue influence (95% within limits of -1.96 to plus 1.96 and with Cook’s distance >1 as outlined in Field (2013). 
The scatterplot of standardised residuals showed that the data met the assumptions of homogeneity of variance and linearity. Examination for multicollinearity showed that the tolerance and variance influence factor measures were within acceptable levels (tolerance >0.4, VIF <2.5 ) as outlined in Tarling (2008). 
The data also meets the assumption of non-zero variances of the predictors.
The results of the regression indicated that the model explained 72.99% of the variance and that the model was a significant predictor of the second period grades, F(2,26) = 533.4, p < 0.001. While the first period grades contributed significantly to the model (B = 0.962, p<0.001), the extra paid classes contributed significantly to the model as well (B = 0.543, p < 0.05). The final predictive model was: second period grades of Math = -0.034 + (0.962*first period grades) + (0.543*extra paid classes)

Logistic Regression

#age, higher -> studytime
# age 15 ~ 22 
# higher: wants to take higher education (binary: yes or no)
# studytime: weekly study time (numeric: 1 - <2 hours, 2 - 2 to 5 hours, 3 - 5 to 10 hours, or 4 - >10 hours)
cat("\n *******table: higher/studytime*******\n") 
## 
##  *******table: higher/studytime*******
with(stdPorlagData, table(higher, studytime))
##       studytime
## higher   1   2   3   4
##    no   44  19   4   2
##    yes 168 286  93  33
cat("\n *******age, studytime*******\n") 
## 
##  *******age, studytime*******
with(stdPorlagData, do.call(rbind, tapply(age, studytime, function(x) c(M=mean(x), SD=sd(x)))))
##          M       SD
## 1 16.71226 1.245747
## 2 16.76066 1.185893
## 3 16.90722 1.233917
## 4 16.34286 1.235334
#Because studytime has four levels we need to indicate which level is a reference
#be comparing the other types of studytime to 2 (2-5 hours)
stdPorlagData$studytime2 <- relevel(as.factor(stdPorlagData$studytime), ref="2")

#create the model using multinom
model_multilog<-multinom(studytime2~higher+age, data = stdPorlagData,model = TRUE)
## # weights:  16 (9 variable)
## initial  value 899.705040 
## iter  10 value 732.769569
## final  value 732.369835 
## converged
cat("\n *******Summary Model*******\n") 
## 
##  *******Summary Model*******
summary(model_multilog)
## Call:
## multinom(formula = studytime2 ~ higher + age, data = stdPorlagData, 
##     model = TRUE)
## 
## Coefficients:
##   (Intercept)  higheryes        age
## 1    3.627297 -1.5501634 -0.1573233
## 3   -3.787012  0.5839930  0.1239967
## 4    3.422724 -0.2631457 -0.3227391
## 
## Std. Errors:
##   (Intercept) higheryes        age
## 1    1.437248 0.3076346 0.07941404
## 3    1.866860 0.5763750 0.09888405
## 4    2.939262 0.7864808 0.16372365
## 
## Residual Deviance: 1464.74 
## AIC: 1482.74
#multinom package does not include p-value calculation for the regression coefficients, 
#calculate p-values using Wald tests (here z-tests).
cat("\n *******z-tests*******\n") 
## 
##  *******z-tests*******
z <- summary(model_multilog)$coefficients/summary(model_multilog)$standard.errors
z
##   (Intercept)  higheryes       age
## 1    2.523779 -5.0389762 -1.981052
## 3   -2.028546  1.0132171  1.253961
## 4    1.164484 -0.3345863 -1.971243
cat("\n *******p-value*******\n") 
## 
##  *******p-value*******
pvalue <- (1 - pnorm(abs(z), 0, 1)) * 2
pvalue
##   (Intercept)    higheryes        age
## 1  0.01161008 4.680288e-07 0.04758548
## 3  0.04250451 3.109565e-01 0.20985619
## 4  0.24422785 7.379372e-01 0.04869608
cat("\n *******Chi-square plus significance*******\n") 
## 
##  *******Chi-square plus significance*******
lmtest::lrtest(model_multilog)
## # weights:  8 (3 variable)
## initial  value 899.705040 
## final  value 754.080307 
## converged
## Likelihood ratio test
## 
## Model 1: studytime2 ~ higher + age
## Model 2: studytime2 ~ 1
##   #Df  LogLik Df  Chisq Pr(>Chisq)    
## 1   9 -732.37                         
## 2   3 -754.08 -6 43.421  9.628e-08 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("\n *******Pseudo Rsquared*******\n") 
## 
##  *******Pseudo Rsquared*******
DescTools::PseudoR2(model_multilog, which="CoxSnell")
##   CoxSnell 
## 0.06471537
DescTools::PseudoR2(model_multilog, which="Nagelkerke")
## Nagelkerke 
## 0.07173848
cat("\n *******Collinearity VIF*******\n")
## 
##  *******Collinearity VIF*******
# It is however sensitive to high correlation between predictor variables (multicollinearity)

vifmodel<-car::vif(model_multilog)  # GVIF^(1/(2*Df)) is the value of interest
## Warning in vif.default(model_multilog): No intercept: vifs may not be sensible.
vifmodel
##    higher       age 
##  11.21731 237.02501
cat("\n *******Tolerance*******\n")
## 
##  *******Tolerance*******
1/vifmodel
##      higher         age 
## 0.089147968 0.004218964
cat("\n *******the sensitivity, specificity, and ROC plot*******\n")
## 
##  *******the sensitivity, specificity, and ROC plot*******
Epi::ROC(form=stdPorlagData$studytime2 ~ stdPorlagData$higher+stdPorlagData$age, plot="ROC")

cat("\n *******Summary of the model with co-efficients*******\n")
## 
##  *******Summary of the model with co-efficients*******
stargazer(model_multilog, type="text")
## 
## ===============================================
##                        Dependent variable:     
##                   -----------------------------
##                       1         3         4    
##                      (1)       (2)       (3)   
## -----------------------------------------------
## higheryes         -1.550***   0.584    -0.263  
##                    (0.308)   (0.576)   (0.786) 
##                                                
## age               -0.157**    0.124   -0.323** 
##                    (0.079)   (0.099)   (0.164) 
##                                                
## Constant           3.627**  -3.787**    3.423  
##                    (1.437)   (1.867)   (2.939) 
##                                                
## -----------------------------------------------
## Akaike Inf. Crit. 1,482.740 1,482.740 1,482.740
## ===============================================
## Note:               *p<0.1; **p<0.05; ***p<0.01
cat("\n *******Exponentiate the coefficients*******\n")
## 
##  *******Exponentiate the coefficients*******
exp(coefficients(model_multilog))
##   (Intercept) higheryes       age
## 1 37.61102793 0.2122133 0.8544278
## 3  0.02266322 1.7931844 1.1320122
## 4 30.65279715 0.7686299 0.7241628
cat("\n ****** odds ratios and 95% CI *******\n")  
## 
##  ****** odds ratios and 95% CI *******
# Odds ratios are used to calculate probabilities in a regression
# OR > 1: Predictor up, Probability of outcome occurring up.
# OR < 1: Predictor down, Probability of outcome occurring down.

cbind(Estimate=round(coef(model_multilog),4), OR=round(exp(coef(model_multilog)),4))
##   (Intercept) higheryes     age (Intercept) higheryes    age
## 1      3.6273   -1.5502 -0.1573     37.6110    0.2122 0.8544
## 3     -3.7870    0.5840  0.1240      0.0227    1.7932 1.1320
## 4      3.4227   -0.2631 -0.3227     30.6528    0.7686 0.7242
#Check the assumption of linearity of independent variables and log odds using a Hosmer-Lemeshow test
generalhoslem::logitgof(stdPorlagData$studytime2, fitted(model_multilog))
## Warning in generalhoslem::logitgof(stdPorlagData$studytime2,
## fitted(model_multilog)): At least one cell in the expected frequencies table is
## < 1. Chi-square approximation may be incorrect.
## Warning in generalhoslem::logitgof(stdPorlagData$studytime2,
## fitted(model_multilog)): Not possible to compute 10 rows. There might be too few
## observations.
## 
##  Hosmer and Lemeshow test (multinomial model)
## 
## data:  stdPorlagData$studytime2, fitted(model_multilog)
## X-squared = 5.4193, df = 12, p-value = 0.9425
#calculate predicted probabilities for each of outcome levels using the fitted function
pp <- fitted(model_multilog)

dses <- data.frame(higher = c("yes", "no"), age = mean(stdPorlagData$age))

#look at the averaged predicted probabilities for different values of the continuous predictor variable write within each level of paid
dwrite_age <- data.frame(higher = rep(c("yes", "no")), age = rep(c(15:22),3))

## store the predicted probabilities for each value of age and paid
pp.write_agepaid <- cbind(dwrite_age, predict(model_multilog, newdata = dwrite_age, type = "probs", se = TRUE))

## calculate the mean probabilities within each level of age
by(pp.write_agepaid[, 3:5], pp.write_agepaid$higher, colMeans)
## pp.write_agepaid$higher: no
##          2          1          3 
## 0.31126795 0.58417784 0.08142109 
## ------------------------------------------------------------ 
## pp.write_agepaid$higher: yes
##         2         1         3 
## 0.5063031 0.2476073 0.2022550
lpp <- reshape2::melt(pp.write_agepaid, id.vars = c("higher", "age"), value.name = "probability")

head(lpp)  # view first few rows
##   higher age variable probability
## 1    yes  15        2   0.4543656
## 2     no  16        2   0.2285790
## 3    yes  17        2   0.5044479
## 4     no  18        2   0.2842026
## 5    yes  19        2   0.5314745
## 6     no  20        2   0.3405711
## plot predicted probabilities across write values for each level of age
ggplot(lpp, aes(x = age, y = probability, colour = higher)) + geom_line() + facet_grid(variable ~
    ., scales = "free")

Report of Logistic regression:
A multinomial logistic regression analysis was conducted with weekly study time for Portuguese course as the outcome variable (1 - <2 hours, 2 - 2 to 5 hours, 3 - 5 to 10 hours, or 4 - >10 hours) with student age (15-22), and want to take higher education as predictors. 
The data met the assumption for independent observations. Examination for multicollinearity showed that the tolerance and variance influence factor measures were not within acceptable levels (tolerance >0.4, VIF <2.5 ) as outlined in Tarling (2008). The Hosmer Lemeshow goodness of fit statistic did not indicate any issues with the assumption of linearity between the independent variables and the log odds of the model (χ2(n=12) =11.09, p =0.9).

Dimension Reduction

dataset from 50 items, for this dimension reduction, I selected three factors: agreebleness, extraversion and openness

std = read.table("studentpIusepersonality.csv",sep=",",header=TRUE) 
std_quest <- std[, -(1:54)]
# subset dataset only keep the IPIP Big-Five 50 item 
cols_A = paste0("A", c(1,2,3,4,5,6,7,8,9,10)) #agreeableness
cols_E = paste0("E", c(1,2,3,4,5,6,7,8,9,10)) #Extraversion
cols_C = paste0("C", c(1,2,3,4,5,6,7,8,9,10)) #Conscientiousness
cols_N = paste0("N", c(1,2,3,4,5,6,7,8,9,10)) #Neuroticism
cols_O = paste0("O", c(1,2,3,4,5,6,7,8,9,10)) #Openness


cols <- c(cols_A, cols_E, cols_O)
std_AEO = std_quest[cols]

std_AEO  #30columns
##     A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 E1 E2 E3 E4 E5 E6 E7 E8 E9 E10 O1 O2 O3 O4
## 1    4  3  4  2  4  2  3  5  2   3  2  3  4  2  5  5  1  2  3   1  4  3  4  4
## 2    3  4  2  4  4  4  3  3  2   3  4  4  5  5  5  4  1  1  1   1  1  2  3  2
## 3    5  5  5  5  5  5  5  2  1   2  3  3  5  2  5  1  1  3  2   2  5  4  4  3
## 4    4  5  4  4  4  5  4  3  1   2  3  2  4  4  4  2  2  3  1   4  4  3  4  4
## 5    3  3  2  4  3  4  4  3  4   4  2  2  3  1  4  3  5  5  4   3  5  2  5  4
## 6    4  4  4  3  4  3  4  3  3   3  3  3  4  2  4  3  2  3  2   3  4  3  4  4
## 7    4  4  4  4  4  4  5  3  2   3  3  4  3  4  3  4  2  3  3   2  4  4  3  4
## 8    5  5  4  3  5  5  4  4  2   2  2  5  5  5  5  3  2  1  2   2  3  4  4  4
## 9    5  3  3  4  4  1  2  3  2   2  2  2  5  3  3  3  2  2  3   1  2  2  4  2
## 10   4  4  5  4  5  4  5  1  1   2  5  4  4  4  5  4  1  2  1   1  0  5  4  4
## 11   1  5  2  3  5  3  4  4  3   5  5  5  5  4  5  3  1  1  2   1  5  5  5  5
## 12   5  4  5  5  5  5  5  1  0   1  4  3  4  3  4  4  2  2  2   3  5  2  4  4
## 13   3  3  2  5  3  4  2  3  1   1  1  1  5  1  4  1  1  5  1   3  4  2  2  4
## 14   2  3  3  4  2  2  4  2  3   2  2  2  2  3  2  3  3  3  3   1  2  2  1  3
## 15   4  5  2  4  4  4  4  2  2   2  2  4  5  4  4  3  1  3  1   2  2  3  4  4
## 16   5  4  3  3  4  4  4  3  3   3  1  4  5  3  4  4  1  3  2   1  3  2  3  3
## 17   3  3  4  2  3  4  4  4  2   2  2  2  4  2  4  1  1  3  2   2  2  2  2  2
## 18   5  5  5  5  5  5  5  4  1   1  5  5  5  2  5  1  1  2  4   1  5  3  4  5
## 19   4  3  3  3  3  2  3  5  3   4  2  5  5  4  4  4  1  2  3   3  2  4  3  4
## 20   3  5  4  4  4  4  5  4  1   2  2  4  4  4  4  2  2  4  1   1  4  4  4  5
## 21   4  4  4  4  4  4  5  3  2   4  2  2  4  2  4  3  3  4  2   4  5  2  4  4
## 22   4  4  4  4  3  3  5  2  2   2  2  4  4  4  4  2  2  2  2   2  4  2  4  2
## 23   4  5  4  4  4  3  4  5  2   4  2  4  5  2  5  5  1  3  1   5  2  2  3  3
## 24   4  4  4  1  4  5  4  5  2   3  2  3  5  2  4  3  5  5  2   3  5  4  5  5
## 25   5  4  4  4  5  5  4  2  2   1  4  2  4  2  4  1  3  4  2   4  4  4  3  5
## 26   3  4  3  4  3  3  4  2  2   4  2  4  3  3  3  2  4  4  3   3  4  3  3  4
## 27   2  4  2  4  4  5  2  2  1   2  2  4  2  4  2  2  2  2  1   1  2  4  4  4
## 28   4  5  4  5  4  4  4  2  1   2  3  3  3  2  4  2  2  2  2   4  2  4  4  3
## 29   4  4  5  3  4  2  4  4  2   2  1  2  4  2  4  2  2  5  1   2  4  2  4  4
## 30   4  3  4  4  3  3  4  2  2   3  1  3  3  2  3  2  2  4  3   1  4  2  3  3
## 31   4  4  4  4  4  4  3  4  2   3  1  2  3  2  4  1  3  2  2   5  4  2  4  4
## 32   4  3  4  3  4  4  4  4  2   2  2  3  5  2  4  2  2  3  4   2  3  2  4  2
## 33   2  4  5  2  5  5  4  1  2   1  3  5  4  2  5  1  1  4  3   4  5  5  4  4
## 34   4  5  5  4  4  5  4  2  2   1  4  4  4  4  5  4  2  2  2   4  2  1  2  1
## 35   3  3  1  2  4  4  4  2  4   4  1  1  2  1  4  4  4  5  4   1  5  1  5  3
## 36   3  3  3  5  4  4  5  3  1   3  4  4  5  5  5  0  1  2  1   1  3  1  3  3
## 37   1  3  1  4  4  4  3  4  2   3  3  3  5  3  5  1  1  3  2   1  4  4  4  3
## 38   3  4  5  5  4  4  5  2  2   4  5  5  5  2  5  5  1  4  3   2  4  1  4  3
## 39   1  5  1  4  5  5  2  2  1   5  5  5  5  4  5  5  1  1  1   1  1  1  1  1
## 40   4  2  3  3  2  3  3  3  3   4  1  2  4  1  4  3  1  5  1   3  4  3  4  4
## 41   5  5  5  5  5  5  5  1  1   1  3  3  4  2  5  4  2  2  2   2  4  2  4  4
## 42   4  4  3  3  3  3  4  4  3   3  2  3  3  2  3  5  3  4  2   4  4  3  2  4
## 43   4  4  5  2  5  4  5  2  2   2  4  4  2  4  4  4  4  1  2   2  2  2  3  3
## 44   4  4  4  4  3  3  4  3  1   2  2  3  4  3  4  3  2  2  2   2  4  2  4  4
## 45   4  5  4  4  4  4  5  4  1   2  3  3  1  2  3  2  2  4  2   1  1  4  4  5
## 46   4  4  4  4  5  5  4  3  1   1  4  4  3  2  4  2  1  1  2   2  4  4  5  4
## 47   4  4  3  3  4  3  4  3  3   3  3  3  5  3  4  1  1  3  2   3  3  4  4  4
## 48   5  5  5  5  5  5  4  5  2   1  4  5  5  5  5  5  5  1  1   1  5  5  5  5
## 49   3  1  2  4  2  2  2  4  1   3  3  2  3  2  4  1  2  2  3   2  2  1  2  1
## 50   4  5  4  4  5  5  5  4  1   3  4  4  4  4  4  1  1  2  2   2  4  5  4  4
## 51   4  4  4  4  5  4  4  3  2   2  3  2  4  1  4  2  1  3  2   4  4  2  4  2
## 52   4  4  4  2  4  4  4  3  2   2  3  3  2  3  3  2  3  4  2   4  0  4  4  4
## 53   3  4  3  4  5  2  5  5  2   1  4  5  5  3  5  4  1  2  1   2  2  3  3  2
## 54   5  4  4  4  4  4  4  4  3   4  4  5  5  4  5  5  2  3  1   5  4  2  2  5
## 55   5  4  5  4  4  4  4  4  1   4  3  4  5  4  5  1  1  2  1   1  4  5  4  3
## 56   5  5  5  5  4  4  5  3  1   1  2  3  4  2  4  2  2  4  5   3  5  1  4  3
## 57   3  4  3  3  2  4  4  4  4   2  2  3  2  2  3  2  3  3  2   2  4  4  4  4
## 58   4  4  4  4  4  4  4  2  2   4  2  2  4  2  5  2  1  5  1   2  5  2  4  4
## 59   5  5  5  5  4  5  5  2  1   3  4  3  5  5  4  4  1  2  1   2  3  2  3  3
## 60   1  4  3  4  5  3  2  3  0   2  4  5  5  3  4  4  3  4  4   1  4  5  1  4
## 61   2  3  2  3  4  3  4  4  2   3  2  3  5  3  4  2  1  2  2   2  2  2  4  2
## 62   4  3  4  5  3  3  4  3  1   1  3  1  5  1  4  3  1  5  1   1  3  1  3  3
## 63   3  3  5  3  3  3  5  2  2   3  1  4  3  2  4  3  3  5  2   1  4  1  4  4
## 64   5  5  4  5  5  3  4  1  1   3  3  3  4  4  4  4  1  2  2   1  4  2  3  4
## 65   4  3  4  4  5  4  4  4  3   2  2  3  4  3  4  1  2  2  2   2  4  2  2  2
## 66   2  3  3  4  4  3  4  1  1   2  1  1  3  1  5  2  2  2  2   3  4  2  5  2
## 67   3  3  1  4  4  3  3  3  3   4  4  4  3  4  4  4  4  3  3   3  4  4  4  4
## 68   1  3  1  1  3  4  2  5  5   3  3  3  4  2  4  3  2  4  1   1  3  1  2  2
## 69   4  5  4  0  4  4  4  4  3   2  3  4  4  2  4  3  2  3  2   2  3  2  3  3
## 70   2  2  4  4  2  1  4  4  4   2  1  1  2  1  4  5  2  5  1   1  4  1  1  5
## 71   5  5  5  3  5  4  5  4  1   3  4  4  5  4  5  5  4  2  1   3  4  3  1  5
## 72   5  5  5  5  4  4  5  2  2   1  1  1  4  2  5  2  1  4  2   1  2  1  3  1
## 73   4  5  5  4  4  4  5  3  1   2  3  4  5  3  5  4  3  3  3   1  5  3  4  3
## 74   4  5  5  4  4  4  4  3  2   3  5  2  4  4  4  5  4  4  2   2  4  4  3  4
## 75   4  4  4  5  5  4  4  4  2   2  1  3  5  4  4  4  1  2  1   1  4  1  4  1
## 76   2  3  2  3  4  3  4  2  3   5  3  3  5  3  4  4  2  4  2   1  4  1  2  3
## 77   5  3  5  5  5  5  5  3  1   3  5  5  5  5  5  3  1  3  1   3  3  1  5  3
## 78   5  2  3  4  4  3  4  2  1   1  1  2  5  1  3  3  1  4  4   2  2  2  3  3
## 79   2  4  4  2  4  3  4  5  1   3  4  3  4  2  3  4  4  4  3   2  2  4  4  5
## 80   4  4  5  4  4  4  4  3  2   2  2  3  4  2  4  2  2  4  0   3  2  4  4  3
## 81   2  4  4  3  4  4  4  3  2   3  2  2  5  2  4  3  2  3  2   3  4  3  3  3
## 82   4  4  4  3  5  3  4  3  3   3  5  5  5  4  5  5  4  1  1   1  5  2  4  3
## 83   4  4  3  4  4  4  4  4  0   2  1  1  4  1  3  2  3  5  2   0  3  3  4  2
## 84   3  3  3  4  4  3  4  3  2   2  2  2  4  2  4  1  2  4  2   5  3  2  4  3
## 85   5  5  5  5  4  5  5  2  1   2  3  4  3  1  4  2  3  4  1   3  2  2  3  3
## 86   3  4  3  4  3  4  0  3  3   2  1  2  2  1  4  1  4  4  3   5  3  3  4  4
## 87   4  4  3  3  4  3  3  3  3   3  1  1  2  2  3  1  2  4  3   1  4  3  4  5
## 88   4  5  5  4  5  5  4  2  1   4  5  5  5  4  4  5  4  1  2   1  2  5  2  2
## 89   2  2  3  3  3  3  4  2  2   2  2  2  2  1  2  2  3  4  2   4  3  4  2  3
## 90   4  4  3  4  4  4  4  2  1   2  2  3  5  3  4  2  1  2  2   1  4  2  5  3
## 91   2  4  4  4  4  4  4  4  2   2  2  4  4  3  4  2  1  2  1   2  4  2  3  4
## 92   4  5  4  4  4  4  4  3  2   4  4  5  4  4  4  4  4  2  2   1  4  3  4  2
## 93   2  3  3  3  3  2  3  5  4   4  1  1  3  1  3  1  4  4  1   2  3  3  3  3
## 94   5  4  5  5  5  4  5  1  1   1  3  2  3  2  4  2  2  4  3   3  4  2  4  2
## 95   5  4  5  5  4  4  4  2  1   4  1  1  4  4  4  2  2  2  2   1  2  4  4  2
## 96   4  1  4  3  1  1  3  5  2   1  1  1  1  1  1  1  5  5  5   1  5  1  5  4
## 97   4  3  5  5  4  3  4  5  1   3  2  4  4  4  4  2  4  4  1   1  3  5  4  2
## 98   5  5  5  5  5  4  5  2  1   2  4  4  5  5  5  5  1  1  1   2  5  2  4  2
## 99   2  4  3  3  2  3  4  4  3   3  1  2  5  3  3  2  1  5  1   2  2  3  3  2
## 100  2  3  3  4  3  3  3  3  2   2  2  2  3  3  4  2  3  4  2   2  4  3  4  5
## 101  2  4  4  4  4  4  4  3  2   2  3  3  4  4  4  3  2  3  3   3  4  2  4  4
## 102  2  5  4  2  3  3  4  4  4   5  3  3  4  2  4  4  2  4  3   3  1  3  4  4
## 103  4  3  5  4  4  4  5  2  2   2  3  2  4  3  4  4  2  5  2   2  4  2  2  3
## 104  2  5  4  2  5  3  4  3  3   2  2  4  2  5  3  2  2  2  1   2  4  2  4  5
## 105  5  5  5  4  4  4  4  2  2   2  4  4  4  4  4  2  2  2  2   2  4  4  4  4
## 106  5  5  4  5  5  4  4  4  1   4  3  3  5  3  4  3  1  4  1   2  4  3  3  4
## 107  2  4  2  3  3  3  4  3  2   1  1  4  4  4  0  4  2  3  2   4  3  2  4  2
## 108  4  4  4  4  4  4  4  0  1   2  2  5  4  3  5  5  1  3  4   1  0  4  5  4
## 109  4  4  4  4  3  4  4  2  2   2  3  2  4  1  4  1  2  5  1   4  4  2  4  3
## 110  3  4  4  4  4  4  4  2  2   2  3  3  1  1  3  1  4  2  2   2  3  4  3  3
## 111  5  4  4  5  4  5  5  2  1   1  1  2  3  4  3  2  1  2  1   4  4  3  4  3
## 112  4  3  3  3  3  2  4  3  2   3  3  4  3  3  4  5  2  2  3   1  4  3  4  3
## 113  2  4  2  3  3  3  3  5  2   3  1  1  3  1  4  2  2  4  2   1  3  1  4  2
## 114  2  2  1  1  2  1  2  4  4   5  1  1  2  1  1  1  4  5  4   1  5  2  4  4
## 115  4  4  5  5  4  4  4  5  1   1  1  1  4  4  4  1  1  2  2   2  5  1  5  5
## 116  5  5  5  4  4  4  5  2  1   2  4  5  5  4  5  5  1  2  1   4  4  4  2  4
## 117  1  1  1  2  2  3  4  4  4   4  2  1  4  1  4  1  2  5  2   4  2  2  4  4
## 118  4  5  4  4  5  4  4  4  3   3  4  4  5  4  3  2  1  2  1   1  4  3  4  4
## 119  3  4  4  5  3  3  4  2  3   2  1  4  5  3  4  4  3  3  2   2  5  2  5  3
## 120  3  4  4  5  5  1  4  1  4   4  1  1  4  1  2  1  5  5  4   3  5  1  3  4
## 121  2  5  4  5  2  5  5  1  3   2  1  4  4  2  2  3  2  5  4   4  5  2  4  4
## 122  4  5  5  4  4  5  4  2  1   4  2  4  5  5  4  5  1  1  1   1  4  2  3  4
## 123  2  3  2  5  3  3  4  5  2   2  3  4  2  4  2  3  4  1  4   2  4  2  4  2
## 124  5  5  5  4  5  5  4  5  1   2  5  0  5  2  5  3  1  5  1   1  4  4  4  3
## 125  5  4  5  4  3  4  4  3  1   3  1  4  3  2  3  2  3  3  2   3  4  3  2  4
## 126  4  4  2  4  4  4  4  3  2   3  2  2  4  3  4  2  2  3  2   3  2  2  4  2
## 127  4  4  4  4  4  4  4  4  2   2  2  2  4  2  4  2  2  2  2   2  2  2  4  4
## 128  4  4  4  4  4  4  3  2  2   4  2  2  4  3  4  3  3  3  2   4  4  3  3  4
## 129  3  4  4  4  3  3  3  3  3   2  2  2  4  2  3  3  1  2  3   3  3  2  4  3
## 130  0  0  0  4  4  0  4  0  2   0  0  0  0  0  0  0  2  0  0   0  0  0  0  0
## 131  5  5  5  5  5  5  3  2  1   1  3  3  5  2  5  2  2  3  1   2  3  3  3  2
## 132  4  4  5  4  5  4  4  4  2   2  3  4  5  4  5  4  1  4  2   1  4  3  4  3
## 133  3  5  4  2  4  4  4  4  2   2  2  3  4  2  4  4  2  4  2   2  2  2  4  4
## 134  4  1  3  2  5  2  4  3  1   1  4  1  5  1  3  1  1  1  1   1  4  4  3  5
## 135  2  3  3  4  4  2  3  3  3   3  2  2  4  3  3  3  2  2  3   2  4  4  4  5
## 136  1  3  4  4  2  2  4  4  2   2  3  4  4  2  4  3  2  3  2   2  4  2  3  3
## 137  0  0  0  0  3  0  4  0  0   0  0  0  0  2  0  0  0  0  0   0  0  0  0  0
## 138  2  3  4  3  4  4  5  4  4   1  3  1  5  1  5  4  2  4  3   3  4  1  4  2
## 139  3  3  3  1  2  1  2  1  3   1  1  1  5  1  3  3  1  5  3   5  3  1  1  1
## 140  4  4  4  4  4  3  4  4  2   2  3  4  5  4  4  2  2  2  2   1  5  2  4  3
## 141  4  2  4  4  4  4  4  3  1   1  1  4  3  2  4  2  3  3  2   2  2  1  3  2
## 142  4  4  3  4  4  4  4  3  2   2  3  3  4  3  4  4  2  2  1   2  4  5  4  4
## 143  4  4  4  4  3  4  4  4  2   2  2  4  4  4  4  3  2  2  2   2  2  3  3  2
## 144  2  4  2  4  4  4  4  4  2   4  1  1  4  1  4  1  4  4  2   5  2  2  4  1
## 145  2  4  3  3  4  3  3  5  3   3  2  1  5  1  4  4  1  5  1   3  4  1  4  3
## 146  4  4  5  4  4  3  4  2  2   2  2  2  4  2  4  3  1  3  2   1  4  2  4  4
## 147  5  4  5  5  5  5  5  2  1   1  1  1  3  1  5  1  4  5  2   2  5  4  5  5
## 148  4  3  4  4  4  4  4  3  2   2  5  4  4  3  4  4  4  3  3   1  5  4  4  5
## 149  4  4  4  4  4  4  4  2  2   3  2  4  3  4  4  2  3  3  1   2  4  4  4  4
## 150  2  3  3  2  3  3  4  2  3   2  1  2  4  1  3  4  2  5  2   5  4  2  3  4
## 151  5  4  4  5  5  5  4  2  1   2  4  3  4  4  5  4  1  1  1   2  4  4  5  5
## 152  4  4  3  4  4  4  4  3  1   4  4  4  4  4  4  2  2  2  2   2  3  3  2  3
## 153  3  4  5  4  4  4  4  4  2   2  3  3  4  3  4  2  1  4  1   1  4  4  4  2
## 154  5  5  4  5  4  4  4  1  1   1  2  2  4  1  4  1  1  4  2   4  2  2  1  3
## 155  4  3  3  3  3  3  4  2  3   2  3  3  4  3  4  1  3  2  3   2  4  4  3  5
## 156  4  5  5  0  4  3  5  2  2   3  3  4  4  3  4  3  2  3  3   3  4  2  4  4
## 157  4  4  4  4  4  4  5  2  2   2  3  3  4  4  3  4  3  1  1   1  2  2  4  4
## 158  4  4  4  1  4  4  4  5  3   2  2  1  4  2  4  4  2  5  4   1  4  4  4  5
## 159  4  4  4  4  4  4  4  2  2   2  4  4  4  2  4  4  2  2  2   4  4  4  4  3
## 160  5  5  5  3  5  5  5  3  3   4  3  2  1  3  2  4  4  3  5   4  4  4  3  5
## 161  1  4  1  4  4  4  1  4  4   4  4  4  4  4  4  2  2  2  1   1  5  2  4  5
## 162  4  4  4  4  4  4  4  4  1   2  2  2  4  3  4  1  1  4  2   2  3  3  4  3
## 163  5  5  5  5  5  5  4  2  1   1  4  5  5  5  5  5  1  1  1   1  2  5  5  4
## 164  5  4  5  4  4  4  4  2  1   1  2  2  2  2  4  3  4  4  2   4  4  4  4  4
## 165  3  3  4  3  4  3  4  2  2   2  2  2  3  2  4  1  3  4  3   2  4  4  4  5
## 166  4  3  3  3  4  4  4  4  3   4  2  2  3  3  3  3  3  2  2   2  3  4  4  4
## 167  2  5  2  2  2  4  4  4  4   2  2  2  4  2  4  2  2  4  1   2  2  2  4  2
## 168  4  4  4  2  3  3  4  5  2   3  2  1  4  3  3  2  2  3  3   4  4  3  5  5
## 169  5  5  4  4  5  4  5  3  1   2  2  3  4  2  4  2  2  3  2   3  4  4  4  3
## 170  4  4  4  5  5  4  4  5  1   2  4  5  3  3  3  3  2  1  1   1  3  4  4  4
## 171  4  4  4  4  4  2  4  2  2   2  4  4  4  2  4  2  2  5  2   2  4  2  4  2
## 172  4  2  4  3  4  4  4  3  2   2  3  1  2  2  4  1  2  4  1   4  5  5  1  4
## 173  4  4  2  3  4  4  4  1  2   2  2  4  2  2  4  3  4  5  2   2  4  2  4  4
## 174  4  5  4  5  5  4  5  1  1   3  2  4  5  3  4  3  1  3  2   1  4  2  3  3
## 175  4  2  4  4  4  3  4  3  2   3  2  1  4  1  4  1  3  3  1   3  3  3  4  4
## 176  4  4  5  4  4  4  3  3  4   2  1  1  4  1  4  3  2  5  2   5  4  3  4  3
## 177  4  4  4  4  3  3  4  5  3   3  5  5  4  4  1  5  4  4  5   1  4  4  4  4
## 178  5  4  5  3  4  4  4  3  2   4  3  4  5  4  5  2  1  2  3   2  2  4  5  5
## 179  3  5  3  4  4  3  5  4  1   2  2  4  4  4  4  4  1  2  4   1  5  3  5  5
## 180  5  4  5  5  4  5  5  3  1   2  2  2  4  1  5  1  2  4  1   4  5  4  4  5
## 181  5  5  5  2  5  5  4  1  1   2  5  4  3  5  4  4  2  1  1   4  4  5  4  5
## 182  3  3  3  3  4  4  4  2  2   2  1  1  2  1  3  1  4  4  3   2  3  2  5  4
## 183  4  4  4  4  4  4  4  2  2   4  4  5  4  5  4  5  2  1  2   1  4  2  4  4
## 184  5  5  5  4  5  4  5  2  2   2  1  1  4  1  4  2  1  5  4   2  4  2  4  3
## 185  2  4  4  4  2  4  4  5  4   2  1  2  4  1  4  1  2  2  1   3  4  2  5  4
## 186  4  4  4  4  4  4  4  3  2   2  3  3  4  4  4  3  2  2  1   2  2  2  3  2
## 187  4  3  4  3  4  4  3  4  3   2  2  3  3  3  4  2  2  2  3   1  4  2  3  3
## 188  1  4  2  2  4  4  4  4  4   3  2  4  4  4  4  2  2  2  2   3  4  2  4  5
## 189  4  4  4  4  4  4  4  3  2   2  2  3  3  4  4  3  2  3  2   2  2  3  3  3
## 190  4  3  4  4  4  3  4  4  2   3  1  2  5  3  4  2  1  4  1   1  4  1  4  0
## 191  4  4  4  4  3  4  4  3  2   3  3  3  3  3  4  3  3  4  2   3  3  3  4  3
## 192  4  4  4  4  4  4  4  2  2   2  2  3  5  1  5  2  2  4  1   3  5  2  4  3
## 193  3  4  4  4  5  4  5  3  2   3  3  2  5  3  5  4  1  3  1   3  4  2  4  4
## 194  5  4  0  4  5  4  5  2  2   1  4  5  5  3  5  4  1  3  2   1  4  4  4  4
## 195  3  3  3  2  4  4  4  3  2   2  3  4  3  3  3  2  3  2  2   2  4  4  4  4
## 196  2  4  2  2  2  2  2  5  2   3  2  3  4  2  4  3  2  3  3   1  4  2  1  3
## 197  3  4  4  4  4  3  4  2  2   2  2  2  4  3  4  2  2  4  2   2  5  3  4  5
## 198  4  4  4  4  4  4  5  4  2   4  2  4  5  4  4  3  1  2  1   1  4  2  4  4
## 199  4  3  3  4  2  3  4  2  2   2  1  1  4  1  3  1  2  5  2   2  4  1  4  2
## 200  2  4  3  3  4  4  4  4  2   3  3  4  4  4  4  3  1  3  3   3  5  4  3  5
## 201  4  5  3  4  4  2  4  1  1   2  2  2  5  2  4  3  1  5  1   4  3  1  1  4
## 202  4  2  4  4  2  2  4  4  3   2  1  1  2  1  2  1  4  5  2   2  5  3  5  5
## 203  2  1  1  2  3  3  1  5  4   1  1  1  4  1  5  1  2  5  3   5  4  3  4  5
## 204  4  5  4  5  5  5  5  4  1   3  5  4  5  5  5  5  1  2  2   2  2  4  4  1
## 205  5  5  5  4  5  4  5  2  2   2  4  4  5  3  5  4  1  3  4   3  4  4  4  4
## 206  2  4  4  2  3  3  4  2  2   2  3  5  4  5  5  4  1  2  1   1  3  1  3  3
## 207  5  4  4  4  5  5  4  4  2   2  3  2  5  1  5  1  1  3  1   5  3  2  5  3
## 208  4  5  4  4  4  3  5  3  2   2  3  5  4  5  4  3  1  1  2   2  5  1  4  4
## 209  5  5  4  5  4  5  5  1  1   2  3  4  4  5  4  2  1  2  1   2  4  4  5  4
## 210  4  5  5  5  4  3  5  1  1   3  3  3  5  3  5  3  1  3  4   2  2  2  3  4
## 211  5  4  5  4  4  5  5  2  3   2  1  1  4  1  4  2  2  4  1   4  2  4  3  4
## 212  5  3  5  4  4  4  5  3  1   1  1  2  4  1  4  4  1  5  2   2  3  2  4  5
## 213  4  4  4  4  4  4  4  2  2   2  3  1  2  2  2  4  1  4  2   1  5  4  4  4
## 214  4  4  4  5  2  4  4  1  1   4  3  5  5  4  4  4  4  4  1   1  5  1  4  3
## 215  4  4  4  4  4  4  5  3  3   1  5  4  3  4  4  4  3  3  2   2  4  4  4  4
## 216  4  4  5  5  4  4  3  2  1   2  1  1  5  1  4  2  1  5  2   3  1  2  4  1
## 217  5  5  4  4  5  4  5  2  1   1  4  5  5  5  5  2  1  1  2   2  2  5  4  3
## 218  4  5  4  3  5  5  3  3  1   2  1  1  3  1  5  2  3  5  4   3  3  4  5  4
## 219  2  4  2  5  3  3  4  4  1   2  2  4  4  5  5  4  1  2  2   2  5  1  3  3
## 220  3  4  4  4  4  4  4  3  2   4  2  4  4  4  3  2  2  2  2   2  3  3  3  3
## 221  3  4  3  3  4  4  4  4  2   2  3  3  4  2  4  3  3  4  2   3  4  3  4  4
## 222  5  5  5  5  5  5  5  2  1   1  3  3  5  3  5  4  1  3  1   2  4  1  2  1
## 223  4  4  4  4  5  4  4  2  2   2  3  5  5  4  5  5  1  2  2   2  3  1  3  4
## 224  2  2  3  4  3  3  2  3  4   4  1  2  4  2  3  2  2  4  2   3  3  1  3  3
## 225  4  3  4  4  4  3  5  4  3   2  2  5  5  3  4  4  1  2  2   1  4  2  4  3
## 226  2  3  5  2  3  2  4  4  2   2  2  1  4  3  4  5  1  2  1   2  2  1  1  1
## 227  4  5  5  4  4  4  5  3  2   2  3  2  4  3  4  5  1  3  2   2  5  2  3  5
## 228  2  4  4  5  3  3  3  3  1   2  3  3  3  2  5  3  2  3  1   2  4  2  4  3
## 229  2  4  2  4  4  3  4  2  2   2  2  4  4  3  4  4  1  2  5   2  4  3  3  4
## 230  5  4  5  5  5  5  2  5  1   3  1  1  3  1  3  3  3  4  1   1  4  3  3  5
## 231  5  4  5  4  5  5  5  2  2   1  2  2  3  3  4  1  2  3  1   2  5  3  4  4
## 232  4  4  4  4  5  5  3  4  2   3  4  4  5  5  5  4  1  2  1   2  2  3  4  4
## 233  4  4  4  4  4  4  4  3  1   2  3  1  5  1  4  1  1  4  1   4  3  2  4  2
## 234  4  5  2  5  4  3  2  4  1   2  5  5  5  4  5  5  1  4  1   4  4  2  4  2
## 235  4  3  4  4  3  4  4  4  2   3  3  2  4  2  4  2  2  4  0   2  4  4  4  3
## 236  4  3  4  5  5  4  4  2  1   2  3  1  5  3  5  3  1  4  1   4  3  2  4  4
## 237  4  5  4  5  4  5  4  1  5   2  4  4  4  4  4  1  1  2  1   2  2  5  2  4
## 238  5  4  4  4  5  4  4  4  2   2  3  5  5  5  4  1  1  1  1   1  2  3  4  4
## 239  4  0  4  4  4  4  4  2  1   2  3  3  5  3  4  4  1  1  1   3  3  1  4  2
## 240  4  4  4  4  4  4  4  2  2   2  2  2  4  2  2  2  2  3  2   2  2  2  2  2
## 241  3  4  4  4  3  3  3  5  2   1  4  5  5  3  5  4  1  2  3   4  5  3  4  5
## 242  4  4  4  3  4  3  4  4  2   3  3  3  4  3  4  4  2  2  2   2  4  4  4  4
## 243  4  5  4  4  4  2  5  4  4   1  5  5  5  2  5  5  1  4  1   1  4  4  4  3
## 244  4  4  4  4  5  3  2  3  3   4  4  4  4  5  4  4  2  2  2   2  4  4  4  3
## 245  0  5  3  5  3  4  4  3  2   2  2  3  3  4  4  3  3  3  3   2  4  2  4  2
## 246  4  4  4  4  3  3  4  1  1   4  2  3  3  3  4  1  3  3  1   3  4  2  5  5
## 247  4  4  5  4  4  3  3  2  2   2  1  1  5  1  4  5  5  3  2   2  4  2  3  4
## 248  3  4  4  3  5  4  4  3  2   2  4  4  3  3  4  4  4  2  3   2  3  3  3  4
## 249  3  4  4  3  4  4  4  3  1   2  1  1  4  1  2  5  2  5  2   2  5  3  3  2
## 250  3  2  3  2  3  3  2  4  4   4  2  4  4  2  3  4  3  4  2   2  3  2  4  5
## 251  3  3  4  3  3  4  3  4  2   3  1  2  2  1  4  1  2  5  5   2  5  3  5  3
## 252  4  3  1  3  5  4  4  3  3   4  3  1  5  3  5  3  1  4  1   5  5  4  5  5
## 253  4  4  4  4  4  4  3  2  1   2  3  4  3  4  4  2  2  4  2   3  3  3  4  4
## 254  3  3  4  1  3  3  3  2  3   4  3  2  3  3  4  5  3  3  2   1  3  2  3  3
## 255  4  3  4  4  3  4  4  3  2   3  2  2  3  2  4  2  2  5  2   4  4  4  4  4
## 256  2  5  3  4  4  4  4  2  1   2  2  4  4  2  4  3  2  4  2   1  5  3  5  5
## 257  4  4  4  3  5  5  5  4  2   2  4  4  4  4  4  4  3  2  3   2  4  3  3  4
## 258  4  4  4  4  4  4  4  2  2   2  3  2  4  2  4  3  2  3  4   1  4  2  2  3
## 259  4  3  4  4  4  4  4  3  3   2  2  3  4  3  4  2  3  3  2   1  3  3  3  4
## 260  5  5  5  4  5  5  4  2  1   3  1  1  4  1  4  1  1  5  4   4  2  2  4  1
## 261  5  5  2  5  5  4  4  2  2   5  2  5  5  5  5  5  5  3  2   2  5  1  4  4
## 262  5  4  5  4  5  5  5  1  1   4  4  2  5  2  5  4  1  4  2   2  4  1  2  2
## 263  5  5  5  5  5  5  5  2  1   1  4  4  5  5  5  4  2  3  1   1  4  4  4  4
## 264  5  5  4  5  4  4  4  3  1   2  4  5  5  2  5  4  1  3  2   1  4  4  5  5
## 265  5  5  5  4  4  4  4  1  1   2  3  4  4  4  4  4  1  2  1   2  2  1  4  2
## 266  4  4  4  4  4  4  4  2  2   1  4  4  4  4  4  3  2  2  2   4  4  4  4  4
## 267  4  4  4  5  4  5  4  2  1   2  2  2  4  3  5  1  1  3  1   1  3  1  3  2
## 268  4  4  4  4  3  4  4  4  2   3  2  2  4  1  5  2  2  4  1   3  4  2  5  4
## 269  5  1  5  2  5  5  2  5  5   1  1  1  2  1  5  5  2  5  1   1  5  1  2  5
## 270  5  5  4  5  5  5  5  2  1   2  5  4  5  4  5  4  1  2  2   1  3  3  4  4
## 271  3  3  2  3  4  4  4  4  2   3  1  3  4  3  4  3  4  3  2   2  4  2  4  4
## 272  4  4  4  3  4  4  2  5  4   3  1  5  5  4  3  1  2  2  2   2  4  1  3  2
## 273  4  4  2  5  5  4  2  5  1   4  3  4  4  1  4  1  4  2  2   2  4  4  2  4
## 274  3  4  3  4  5  3  3  4  1   3  3  3  4  3  5  3  2  3  2   2  3  2  3  3
## 275  4  3  5  4  4  4  4  2  3   2  2  2  4  1  4  3  2  4  3   2  4  1  2  3
## 276  4  4  5  5  4  4  4  2  1   2  4  4  4  4  4  3  1  3  2   1  4  4  4  4
## 277  5  5  5  4  5  5  5  2  1   1  4  5  4  2  5  4  1  2  1   1  4  5  5  4
## 278  2  3  4  4  3  3  4  5  2   3  1  1  3  2  2  3  3  5  2   2  4  2  3  3
## 279  0  3  5  0  3  4  4  5  0   5  1  3  5  2  0  1  0  3  5   5  5  3  0  4
## 280  3  4  4  4  4  3  4  3  2   3  3  4  3  4  3  3  3  2  2   2  4  4  3  4
## 281  2  2  2  3  1  4  4  5  2   4  3  4  4  3  3  2  4  2  4   1  5  5  3  1
## 282  4  4  4  4  4  4  5  3  2   3  2  2  4  2  4  2  2  4  3   2  4  3  4  4
## 283  4  4  4  3  3  4  4  3  3   3  2  2  4  2  4  1  2  4  2   2  4  1  4  3
## 284  2  5  5  3  5  5  5  2  3   2  5  5  5  5  5  5  1  2  2   2  5  3  5  5
## 285  5  4  4  5  3  4  5  2  1   1  2  4  4  2  4  2  2  3  2   4  4  5  4  3
## 286  5  5  5  4  4  4  5  2  1   2  4  2  5  4  4  5  1  4  2   1  3  2  2  3
## 287  4  2  4  3  4  4  2  3  4   5  1  1  3  1  3  2  3  5  1   2  2  3  2  3
## 288  4  4  4  5  4  4  5  4  0   1  2  4  5  3  4  2  1  2  1   2  4  3  4  3
## 289  4  5  4  4  4  5  4  3  2   1  1  2  3  2  3  2  4  5  2   4  3  2  4  3
## 290  4  3  3  2  4  4  3  4  3   3  3  3  4  4  4  4  3  3  3   2  3  4  4  3
## 291  3  2  3  2  3  3  4  4  4   4  3  4  2  3  3  2  2  2  4   1  5  4  5  5
## 292  4  4  5  5  4  4  4  4  2   1  3  5  4  5  4  4  4  2  1   1  4  5  5  5
## 293  4  2  4  4  4  5  2  5  2   5  1  5  5  1  4  2  4  4  5   1  5  4  5  5
## 294  3  4  4  4  4  3  4  2  1   1  2  1  5  1  4  2  1  5  2   5  4  3  5  4
## 295  5  5  5  5  5  5  5  3  1   1  2  2  5  1  5  4  1  5  3   5  5  2  5  5
## 296  4  2  4  3  3  3  3  3  2   4  1  1  4  2  0  2  2  5  2   2  5  1  2  5
## 297  4  5  4  2  5  4  4  5  2   1  3  3  5  3  4  2  2  5  3   3  4  4  4  4
## 298  4  4  4  3  4  4  4  4  2   2  3  4  4  4  2  3  3  4  2   4  4  4  2  2
## 299  3  3  2  3  2  3  4  4  3   3  1  2  4  2  4  2  2  4  2   2  4  4  5  4
## 300  5  4  4  4  5  4  4  5  2   2  2  2  5  2  5  4  1  3  1   4  5  2  4  4
## 301  4  4  4  4  4  3  4  2  2   2  3  4  4  3  3  3  4  2  2   2  4  4  4  3
## 302  4  4  4  4  4  4  4  4  2   2  3  3  4  2  5  4  2  3  2   1  2  4  2  2
## 303  5  5  4  5  5  4  5  3  1   2  4  5  5  4  5  5  2  1  3   1  4  1  3  4
## 304  4  4  1  4  3  3  4  2  4   2  2  2  4  2  4  2  2  5  2   2  4  2  2  4
## 305  5  4  4  4  5  3  2  4  1   2  2  2  5  2  5  2  1  5  2   2  5  4  5  5
## 306  3  3  4  3  3  4  4  3  3   4  4  2  3  4  3  1  3  4  2   4  4  3  4  4
## 307  4  3  4  4  3  3  2  4  3   3  1  2  4  2  3  3  2  4  2   2  3  1  3  3
## 308  3  4  5  3  4  4  5  3  2   1  3  4  5  3  4  4  1  3  2   3  5  2  5  4
## 309  1  1  1  1  1  1  2  5  5   2  1  1  1  1  1  1  5  5  5   5  4  4  2  4
## 310  2  4  4  3  4  4  2  4  2   4  3  2  4  2  4  2  2  3  2   2  4  2  4  4
## 311  4  4  3  4  4  4  4  2  2   3  3  5  4  4  4  5  1  1  3   1  3  2  3  2
## 312  4  5  5  5  4  3  4  2  1   3  1  1  5  1  5  5  1  5  2   1  5  1  5  5
## 313  5  5  5  5  5  4  5  4  1   2  5  3  4  4  4  3  1  2  5   5  5  3  4  3
## 314  5  5  5  5  5  5  5  2  1   2  1  1  2  1  5  2  4  5  1   1  3  1  4  4
## 315  5  4  4  4  0  3  4  4  4   2  5  4  5  4  5  5  2  2  1   2  4  4  4  4
## 316  5  5  5  5  4  3  5  2  2   3  2  2  4  2  4  3  2  4  2   3  4  2  4  3
## 317  4  4  2  4  4  3  4  3  2   2  3  5  4  3  4  3  2  4  2   2  4  3  4  4
## 318  4  4  4  4  4  4  4  4  2   2  4  2  4  2  4  4  2  4  2   4  3  4  4  2
## 319  1  2  1  3  2  2  4  4  3   2  1  2  2  1  2  1  4  4  3   5  5  1  4  3
## 320  5  5  5  5  4  4  4  1  1   3  3  4  5  4  4  4  1  1  2   2  4  2  2  2
## 321  2  4  4  4  4  3  4  3  2   2  2  2  3  3  4  2  2  4  4   3  4  3  3  3
## 322  4  4  5  4  5  5  4  2  1   2  4  3  5  4  5  5  1  4  2   2  5  1  4  4
## 323  5  4  5  5  5  4  5  2  1   1  3  3  5  2  4  2  1  3  1   2  4  5  5  5
## 324  1  5  4  5  4  4  5  2  4   1  2  3  5  4  4  4  1  4  2   1  3  4  4  4
## 325  4  2  4  5  3  4  4  4  1   3  2  2  3  4  4  2  2  4  2   2  4  3  4  5
## 326  5  4  4  4  3  4  4  4  4   3  2  1  4  1  4  2  4  4  1   5  4  4  5  4
## 327  3  4  4  3  4  4  4  4  3   4  2  4  4  3  3  1  1  3  2   2  4  3  4  4
## 328  4  5  2  5  5  5  1  2  1   1  5  4  4  4  5  3  2  2  1   3  5  5  5  4
## 329  4  4  5  4  4  4  4  2  2   2  2  2  5  2  4  2  2  3  1   4  4  4  4  3
## 330  4  4  4  4  4  5  4  3  2   3  4  4  4  4  4  3  2  2  2   2  3  3  3  3
## 331  4  5  4  5  4  4  5  3  2   2  2  3  4  5  3  1  2  1  2   1  5  2  4  3
## 332  4  5  4  4  4  4  5  3  2   2  3  4  4  2  4  4  2  2  2   2  4  4  4  4
## 333  5  4  5  4  5  5  4  3  1   2  3  2  4  2  4  1  2  3  2   1  4  4  5  5
## 334  4  5  4  4  4  4  4  2  2   2  2  1  2  4  2  2  4  5  2   2  4  5  4  4
## 335  5  5  5  5  5  4  5  2  4   1  2  1  5  1  5  5  1  5  1   1  2  2  3  5
## 336  5  4  3  4  5  4  4  4  3   3  3  5  5  5  5  5  1  1  5   3  5  4  5  5
## 337  5  5  5  4  5  4  4  1  3   4  3  3  5  4  5  5  1  4  1   2  5  1  4  4
## 338  4  4  2  4  5  2  1  4  4   4  4  5  4  2  4  4  2  2  4   2  4  4  4  3
## 339  4  5  5  5  5  5  4  2  1   2  4  1  5  1  5  4  1  2  2   4  3  3  4  4
## 340  4  5  4  5  5  4  5  1  1   1  4  5  5  4  4  2  4  2  1   2  5  5  5  5
## 341  4  4  5  4  4  4  5  4  2   1  2  2  4  2  4  1  4  2  2   2  4  5  4  2
## 342  5  4  4  3  4  4  4  2  3   1  3  3  4  2  4  2  3  3  2   3  3  4  4  3
## 343  3  4  4  4  3  3  3  2  2   2  1  2  3  2  3  4  3  3  4   1  4  2  4  5
## 344  5  5  5  5  4  3  4  2  2   2  2  2  3  3  4  2  2  2  2   2  3  3  4  4
## 345  4  4  4  4  5  5  5  2  1   1  4  4  4  3  5  2  1  2  1   2  4  4  5  4
## 346  4  4  4  4  4  4  5  2  1   2  3  4  4  4  4  4  2  2  2   3  4  4  4  3
## 347  4  4  2  4  4  3  4  1  2   2  5  5  4  4  5  5  4  3  4   1  4  1  4  5
## 348  3  5  4  2  4  4  4  4  2   4  3  4  4  4  4  2  2  1  1   1  5  3  3  4
## 349  4  3  3  2  3  3  4  4  3   2  2  4  2  1  4  1  2  1  1   3  4  3  4  2
## 350  4  4  4  4  4  4  4  3  2   3  2  3  5  2  5  3  1  4  1   2  4  2  4  5
## 351  4  2  2  2  4  3  4  4  3   4  2  2  4  2  4  2  1  4  2   1  5  1  3  3
## 352  4  3  4  3  4  3  3  4  2   2  5  4  4  4  4  5  2  2  2   2  2  3  2  2
## 353  3  3  3  4  4  3  4  3  2   3  3  4  4  3  3  4  4  3  3   1  3  3  4  3
## 354  3  4  3  2  4  4  4  2  3   4  3  4  4  4  4  2  1  4  3   2  4  4  5  4
## 355  4  3  3  4  4  4  3  3  2   4  1  2  4  2  4  4  2  4  2   2  3  3  3  3
## 356  5  5  5  5  5  5  5  4  1   1  3  4  4  1  5  5  2  3  3   1  3  4  5  3
## 357  4  3  4  4  3  3  4  4  2   1  2  3  4  2  4  3  1  4  2   2  3  2  3  2
## 358  3  4  4  3  4  4  4  2  2   3  1  1  5  1  5  3  1  5  1   2  3  3  2  1
## 359  0  0  0  0  5  0  3  0  0   0  0  0  0  0  0  0  0  0  0   0  0  0  0  0
## 360  4  4  4  4  4  4  4  3  2   2  3  4  4  2  4  3  2  2  2   1  4  4  2  3
## 361  4  5  4  4  5  5  4  2  1   1  3  3  0  1  5  4  5  2  1   2  5  2  1  5
## 362  2  2  4  3  3  3  3  5  3   2  1  1  1  1  2  2  4  4  3   5  4  3  4  4
## 363  4  4  5  4  5  4  3  5  4   5  4  5  5  5  5  4  5  5  4   4  4  5  4  4
## 364  4  4  4  4  3  4  2  5  2   5  1  4  3  1  3  3  3  2  3   3  5  3  4  5
## 365  3  4  4  4  4  3  4  4  2   4  1  4  2  2  3  1  4  2  2   1  4  1  2  5
## 366  5  3  4  4  4  3  4  1  1   1  4  3  5  2  4  2  1  2  2   1  4  2  4  2
## 367  4  4  3  4  5  4  3  3  2   2  4  3  5  2  4  4  1  3  1   2  2  1  3  4
## 368  4  2  3  3  4  3  4  3  3   4  1  1  4  1  4  3  2  5  2   4  4  2  4  3
## 369  4  3  3  3  4  4  4  3  2   3  2  4  5  4  5  2  1  2  3   4  4  1  4  3
## 370  5  5  5  5  4  5  5  3  2   3  2  2  3  2  5  2  2  4  2   3  5  2  4  2
## 371  4  2  4  4  3  4  2  2  2   3  2  0  3  1  4  2  3  4  3   2  4  3  1  2
## 372  4  4  4  4  4  4  4  4  2   4  2  4  4  4  4  2  2  4  2   2  4  1  3  2
## 373  1  1  3  1  1  3  2  5  5   4  2  1  1  1  2  2  4  5  2   3  4  4  4  5
## 374  4  4  4  4  5  5  4  4  1   1  3  3  2  3  3  1  2  3  2   3  3  4  4  4
## 375  4  4  4  4  4  5  4  3  2   2  2  3  3  3  4  2  2  3  1   1  3  3  4  3
## 376  5  4  4  4  3  5  2  2  1   2  2  4  4  2  4  3  2  2  2   4  2  4  2  2
## 377  4  4  3  4  4  3  4  3  4   4  2  4  3  4  4  3  4  2  4   2  4  4  2  2
## 378  5  5  5  5  4  5  5  3  1   3  3  4  4  4  4  4  1  2  1   3  5  3  4  5
## 379  5  4  5  4  5  5  5  2  1   1  2  1  4  1  5  2  1  5  2   2  2  2  4  4
## 380  5  5  2  4  4  4  4  2  1   1  4  5  4  4  5  3  5  1  1   2  5  5  2  5
## 381  5  5  5  4  4  5  4  3  1   1  2  2  5  3  4  1  1  4  2   3  4  4  4  4
## 382  5  5  5  4  4  4  4  2  2   2  1  1  4  1  5  2  1  5  1   2  5  1  3  4
##     O5 O6 O7 O8 O9 O10
## 1    4  4  4  2  2   4
## 2    2  4  4  3  4   4
## 3    4  4  3  3  3   4
## 4    4  2  2  4  2   2
## 5    4  5  1  5  3   5
## 6    4  2  2  2  3   3
## 7    4  2  3  2  2   2
## 8    4  4  2  3  3   4
## 9    2  2  2  5  5   4
## 10   4  1  1  1  1   2
## 11   5  1  1  1  1   5
## 12   4  4  4  4  5   5
## 13   5  4  4  1  1   3
## 14   2  5  5  5  4   5
## 15   4  2  2  4  4   4
## 16   3  4  3  5  5   4
## 17   2  0  4  4  4   4
## 18   4  5  4  1  1   2
## 19   5  2  5  3  3   2
## 20   5  2  4  3  4   4
## 21   5  4  4  4  5   5
## 22   5  4  2  4  2   4
## 23   5  3  5  5  5   5
## 24   4  2  1  4  4   3
## 25   4  1  2  2  2   4
## 26   4  2  3  2  2   3
## 27   4  4  4  1  1   1
## 28   4  3  2  4  2   2
## 29   5  4  2  4  4   4
## 30   2  3  3  4  4   4
## 31   4  2  2  2  2   2
## 32   4  2  4  3  2   4
## 33   5  2  2  4  4   3
## 34   2  5  4  5  5   5
## 35   5  4  2  4  4   5
## 36   4  4  3  5  5   5
## 37   4  2  3  4  4   1
## 38   4  2  2  4  2   5
## 39   1  4  5  5  5   5
## 40   4  3  4  2  2   4
## 41   2  5  3  5  5   5
## 42   4  4  4  5  4   2
## 43   3  4  4  4  4   3
## 44   3  4  2  3  3   4
## 45   5  3  2  2  1   3
## 46   4  2  2  2  2   2
## 47   5  3  3  2  3   3
## 48   4  1  1  1  1   2
## 49   3  4  4  5  5   5
## 50   5  2  2  2  1   2
## 51   3  3  2  3  3   4
## 52   3  1  2  2  2   2
## 53   3  5  3  3  3   3
## 54   4  2  5  5  2   5
## 55   5  3  2  3  1   3
## 56   3  2  2  3  3   5
## 57   4  3  2  5  2   4
## 58   4  3  2  4  4   4
## 59   4  3  3  3  3   3
## 60   5  2  4  3  1   1
## 61   3  4  2  4  2   4
## 62   4  4  3  5  5   5
## 63   5  4  1  4  4   3
## 64   3  4  5  4  4   2
## 65   2  4  3  4  4   4
## 66   4  4  3  4  3   3
## 67   4  1  2  3  5   4
## 68   2  4  4  3  4   4
## 69   4  4  4  4  4   4
## 70   1  5  4  5  1   4
## 71   4  3  3  2  3   2
## 72   2  4  4  5  4   4
## 73   4  2  2  3  4   3
## 74   4  4  2  4  4   3
## 75   4  3  4  5  4   5
## 76   4  3  2  3  2   5
## 77   3  5  5  5  5   5
## 78   3  4  3  2  4   4
## 79   5  5  4  4  2   2
## 80   4  3  3  0  2   2
## 81   3  3  4  4  3   4
## 82   3  4  3  5  4   5
## 83   4  4  2  4  4   4
## 84   3  2  2  4  4   4
## 85   4  3  4  4  4   4
## 86   4  2  2  3  4   3
## 87   5  3  2  4  3   4
## 88   4  4  4  5  5   4
## 89   4  3  2  4  4   3
## 90   4  3  1  1  3   4
## 91   5  3  4  4  4   4
## 92   4  2  3  4  4   4
## 93   4  4  4  5  4   5
## 94   4  2  2  3  4   4
## 95   3  5  5  4  4   4
## 96   3  1  1  1  1   1
## 97   3  2  5  2  1   1
## 98   4  4  4  4  4   4
## 99   3  5  5  3  5   2
## 100  4  3  2  3  2   3
## 101  4  2  2  4  4   4
## 102  2  2  2  5  2   4
## 103  2  4  4  4  5   4
## 104  4  4  4  4  2   4
## 105  3  4  3  2  4   4
## 106  5  3  2  4  4   3
## 107  3  2  3  3  4   5
## 108  4  1  1  1  1   2
## 109  4  2  1  2  3   4
## 110  4  3  3  2  3   2
## 111  3  1  2  2  2   3
## 112  3  2  2  3  3   3
## 113  2  4  4  4  3   5
## 114  4  2  1  1  2   4
## 115  3  5  1  5  1   5
## 116  3  3  3  1  4   4
## 117  5  2  2  2  1   4
## 118  4  4  4  3  4   3
## 119  0  3  3  4  2   5
## 120  4  4  4  5  4   4
## 121  4  2  2  2  4   4
## 122  4  2  2  5  5   4
## 123  4  2  4  4  4   4
## 124  3  0  4  2  1   3
## 125  2  4  3  3  3   4
## 126  4  2  2  5  3   4
## 127  4  4  2  4  2   4
## 128  4  2  2  2  2   2
## 129  1  5  2  1  3   1
## 130  0  0  0  0  0   0
## 131  5  3  4  3  5   4
## 132  4  3  2  3  3   4
## 133  4  4  4  4  2   5
## 134  2  2  1  1  1   2
## 135  4  2  2  4  2   4
## 136  3  4  4  4  4   4
## 137  0  0  0  0  0   0
## 138  3  4  4  5  5   4
## 139  1  5  5  5  5   5
## 140  3  4  4  4  2   4
## 141  3  4  4  4  4   5
## 142  4  1  1  1  1   2
## 143  4  4  4  4  4   4
## 144  2  5  5  5  1   5
## 145  3  4  2  5  5   5
## 146  4  4  4  5  4   5
## 147  5  2  2  2  1   2
## 148  4  4  4  4  4   4
## 149  5  4  3  2  1   2
## 150  4  5  4  5  5   4
## 151  5  1  1  1  1   5
## 152  4  2  4  2  2   3
## 153  3  2  2  2  2   2
## 154  4  4  4  4  4   4
## 155  5  3  2  5  3   2
## 156  4  2  3  4  4   3
## 157  3  4  4  4  3   2
## 158  4  4  4  1  2   1
## 159  4  4  4  2  3   4
## 160  4  3  3  3  3   3
## 161  4  4  3  4  4   2
## 162  4  3  3  3  4   4
## 163  3  1  1  1  4   1
## 164  4  2  2  2  2   4
## 165  5  3  5  3  3   4
## 166  4  4  3  3  2   4
## 167  2  2  4  4  4   4
## 168  5  2  1  3  3   4
## 169  4  2  3  3  2   2
## 170  4  5  2  1  4   2
## 171  2  4  2  4  1   4
## 172  4  2  1  1  1   4
## 173  5  1  2  1  1   4
## 174  3  4  4  2  2   5
## 175  3  3  3  2  3   4
## 176  4  4  3  3  4   4
## 177  3  2  2  3  2   4
## 178  4  1  3  1  2   1
## 179  5  1  1  2  2   4
## 180  4  2  2  1  2   2
## 181  5  2  1  1  1   2
## 182  4  2  2  2  2   4
## 183  2  4  2  4  4   4
## 184  4  4  4  5  5   4
## 185  3  4  4  4  4   4
## 186  4  4  4  3  4   4
## 187  4  3  3  3  4   4
## 188  3  4  2  5  4   4
## 189  4  4  4  4  4   2
## 190  3  5  2  3  2   4
## 191  3  3  3  3  2   3
## 192  4  3  3  4  3   4
## 193  4  3  2  2  2   4
## 194  4  2  3  4  0   3
## 195  4  3  2  3  2   3
## 196  3  5  4  4  4   4
## 197  5  2  2  2  2   2
## 198  4  2  2  1  1   4
## 199  2  4  4  5  5   5
## 200  3  2  2  4  3   3
## 201  1  5  3  5  5   5
## 202  5  1  1  2  2   5
## 203  4  2  4  3  4   3
## 204  4  2  4  4  2   4
## 205  4  2  1  2  2   3
## 206  1  2  2  5  5   5
## 207  4  1  2  4  3   4
## 208  4  3  2  1  5   4
## 209  4  1  1  1  1   4
## 210  3  4  4  4  5   4
## 211  4  3  3  2  3   3
## 212  3  3  4  4  3   4
## 213  4  2  4  1  5   4
## 214  4  2  1  1  1   2
## 215  4  2  3  2  2   4
## 216  2  4  2  2  3   4
## 217  2  2  4  2  2   4
## 218  4  3  3  3  2   3
## 219  2  5  4  5  5   5
## 220  3  4  4  3  3   4
## 221  3  1  2  3  4   4
## 222  2  5  5  5  5   5
## 223  2  4  4  4  5   4
## 224  3  4  4  5  4   5
## 225  3  4  4  5  4   4
## 226  2  5  5  5  5   5
## 227  5  2  2  3  2   2
## 228  4  2  2  3  3   4
## 229  3  3  4  5  3   4
## 230  5  1  5  1  3   4
## 231  3  1  2  2  2   3
## 232  4  5  4  4  3   4
## 233  3  1  2  2  4   5
## 234  3  2  4  4  5   4
## 235  4  3  2  1  2   3
## 236  3  4  4  4  5   4
## 237  4  4  2  2  2   2
## 238  2  2  2  4  2   3
## 239  4  3  3  4  4   4
## 240  4  2  3  2  2   2
## 241  4  3  3  3  4   4
## 242  4  4  4  3  4   4
## 243  4  1  1  1  1   2
## 244  4  2  2  2  4   4
## 245  3  3  3  5  4   3
## 246  5  2  2  2  1   4
## 247  3  3  3  5  5   5
## 248  4  3  2  3  4   2
## 249  3  4  5  4  2   4
## 250  3  2  4  4  4   4
## 251  3  4  2  4  2   4
## 252  4  2  1  2  2   4
## 253  4  2  3  2  2   2
## 254  3  5  2  2  3   2
## 255  4  2  2  2  1   4
## 256  5  2  1  2  4   4
## 257  4  2  4  2  3   4
## 258  3  4  4  4  2   4
## 259  3  2  2  3  3   4
## 260  2  4  3  4  5   5
## 261  2  5  5  5  5   5
## 262  2  2  3  5  5   5
## 263  5  3  2  4  4   4
## 264  4  1  2  5  4   2
## 265  2  4  4  5  5   0
## 266  4  2  1  1  2   4
## 267  4  5  4  5  5   5
## 268  3  1  2  1  1   3
## 269  5  5  5  5  4   5
## 270  3  3  4  4  3   4
## 271  4  4  4  3  3   4
## 272  3  4  3  2  3   5
## 273  4  4  5  5  4   2
## 274  4  4  4  4  3   4
## 275  2  5  5  4  4   5
## 276  3  2  2  2  3   1
## 277  5  5  2  1  1   2
## 278  3  4  2  4  4   4
## 279  3  0  3  4  5   4
## 280  4  2  2  1  2   0
## 281  2  4  3  4  4   4
## 282  4  3  4  3  4   4
## 283  3  3  2  4  4   4
## 284  5  3  2  3  2   3
## 285  3  2  2  2  2   1
## 286  4  1  4  4  5   5
## 287  2  2  4  2  2   4
## 288  4  2  2  4  2   4
## 289  3  3  2  3  3   4
## 290  3  4  4  3  4   2
## 291  4  1  1  1  2   4
## 292  4  3  2  2  5   4
## 293  4  1  1  1  4   5
## 294  4  2  1  1  2   3
## 295  5  5  5  4  3   3
## 296  5  4  4  4  4   4
## 297  4  4  3  4  1   2
## 298  4  4  4  4  4   4
## 299  4  4  2  2  2   4
## 300  5  1  1  1  4   4
## 301  3  3  3  2  2   2
## 302  4  4  4  5  4   4
## 303  4  4  5  4  4   4
## 304  2  4  4  4  4   4
## 305  4  1  1  1  2   2
## 306  5  4  4  2  2   2
## 307  2  5  3  5  4   5
## 308  4  2  2  4  4   3
## 309  4  4  2  4  4   1
## 310  4  2  1  4  4   3
## 311  2  4  4  4  4   2
## 312  5  2  1  5  5   1
## 313  5  3  4  4  2   2
## 314  4  4  2  5  2   4
## 315  3  4  3  2  2   4
## 316  3  3  4  4  4   4
## 317  4  2  2  2  1   4
## 318  4  2  2  2  2   4
## 319  4  4  5  5  5   5
## 320  3  2  4  4  5   4
## 321  4  3  2  4  4   4
## 322  3  3  1  4  4   4
## 323  5  1  1  1  1   1
## 324  4  4  4  2  2   4
## 325  4  3  3  2  2   5
## 326  3  5  4  1  4   2
## 327  5  2  2  2  3   3
## 328  5  1  1  1  1   1
## 329  3  1  2  2  4   2
## 330  4  3  3  0  3   3
## 331  3  3  4  3  2   4
## 332  4  2  3  3  4   4
## 333  5  1  2  2  1   4
## 334  4  2  4  3  4   4
## 335  5  5  5  5  4   5
## 336  5  2  2  4  4   4
## 337  4  1  5  2  4   4
## 338  3  4  2  4  4   4
## 339  4  4  4  4  4   2
## 340  5  5  1  1  2   1
## 341  4  4  2  2  2   2
## 342  4  3  2  2  2   2
## 343  5  3  3  4  5   4
## 344  3  4  2  2  2   5
## 345  4  1  2  1  1   1
## 346  4  2  2  2  2   4
## 347  4  2  1  2  1   4
## 348  4  2  2  4  4   4
## 349  2  1  1  2  2   2
## 350  5  2  2  2  4   4
## 351  3  4  4  5  4   5
## 352  3  2  4  4  4   4
## 353  3  1  3  3  3   3
## 354  4  2  2  1  2   4
## 355  3  4  4  4  2   3
## 356  5  1  4  1  1   2
## 357  4  4  4  5  4   3
## 358  3  4  4  4  4   4
## 359  0  0  0  0  0   0
## 360  2  3  3  3  3   3
## 361  3  4  5  4  1   4
## 362  4  1  2  2  2   4
## 363  4  5  4  4  4   5
## 364  4  1  1  1  1   2
## 365  3  2  4  5  3   5
## 366  2  2  2  2  4   5
## 367  5  2  4  5  5   4
## 368  3  3  4  3  4   4
## 369  4  3  2  4  4   5
## 370  4  4  3  4  4   3
## 371  3  4  2  4  4   4
## 372  3  4  4  5  5   5
## 373  5  4  2  5  2   5
## 374  4  3  1  1  1   2
## 375  3  3  3  3  4   5
## 376  3  4  4  4  4   4
## 377  3  4  3  4  3   3
## 378  4  1  2  4  4   2
## 379  3  1  1  4  5   4
## 380  3  5  1  1  1   1
## 381  4  4  3  3  2   3
## 382  4  4  5  5  4   5

Step 1 explore correlation and significance by visualisation

# 1 correlation matrix
perstdMatrix_AEO<-cor(std_AEO)
round(perstdMatrix_AEO, 2)
##        A1    A2    A3    A4    A5    A6    A7    A8    A9   A10    E1    E2
## A1   1.00  0.39  0.56  0.43  0.42  0.45  0.31 -0.18 -0.30 -0.16  0.22  0.12
## A2   0.39  1.00  0.43  0.40  0.44  0.51  0.37 -0.17 -0.27 -0.08  0.36  0.37
## A3   0.56  0.43  1.00  0.33  0.30  0.44  0.41 -0.11 -0.28 -0.16  0.16  0.04
## A4   0.43  0.40  0.33  1.00  0.28  0.34  0.25 -0.24 -0.39 -0.18  0.18  0.15
## A5   0.42  0.44  0.30  0.28  1.00  0.46  0.26 -0.21 -0.37 -0.15  0.38  0.21
## A6   0.45  0.51  0.44  0.34  0.46  1.00  0.27 -0.09 -0.27 -0.07  0.29  0.20
## A7   0.31  0.37  0.41  0.25  0.26  0.27  1.00 -0.28 -0.28 -0.26  0.20  0.15
## A8  -0.18 -0.17 -0.11 -0.24 -0.21 -0.09 -0.28  1.00  0.30  0.24 -0.06  0.02
## A9  -0.30 -0.27 -0.28 -0.39 -0.37 -0.27 -0.28  0.30  1.00  0.30 -0.16 -0.10
## A10 -0.16 -0.08 -0.16 -0.18 -0.15 -0.07 -0.26  0.24  0.30  1.00 -0.03  0.09
## E1   0.22  0.36  0.16  0.18  0.38  0.29  0.20 -0.06 -0.16 -0.03  1.00  0.57
## E2   0.12  0.37  0.04  0.15  0.21  0.20  0.15  0.02 -0.10  0.09  0.57  1.00
## E3   0.28  0.36  0.21  0.26  0.29  0.23  0.15  0.03 -0.14  0.08  0.32  0.31
## E4   0.13  0.35  0.09  0.18  0.24  0.22  0.19 -0.03 -0.12  0.12  0.52  0.65
## E5   0.39  0.43  0.28  0.34  0.41  0.43  0.19 -0.06 -0.15 -0.05  0.40  0.28
## E6   0.15  0.29  0.17  0.10  0.18  0.08  0.12 -0.04  0.01  0.07  0.41  0.38
## E7  -0.08 -0.13 -0.10 -0.09 -0.21 -0.08 -0.17  0.14  0.24  0.17 -0.10 -0.02
## E8  -0.03 -0.13  0.05 -0.09 -0.25 -0.05 -0.11  0.08  0.22  0.07 -0.39 -0.53
## E9  -0.11 -0.08 -0.07 -0.15 -0.15 -0.14 -0.09  0.13  0.15  0.15 -0.07  0.04
## E10  0.02  0.01  0.05 -0.07 -0.10  0.10 -0.06  0.04  0.10 -0.01 -0.10 -0.20
## O1   0.08  0.09  0.11  0.08 -0.01  0.08  0.06  0.14  0.09  0.10  0.04  0.07
## O2   0.18  0.20  0.13  0.04  0.15  0.26  0.04  0.13 -0.04 -0.04  0.34  0.26
## O3   0.20  0.21  0.14  0.18  0.11  0.24  0.16  0.11  0.00 -0.03  0.08  0.11
## O4   0.12  0.14  0.13 -0.01  0.09  0.14  0.02  0.10  0.11  0.07  0.11  0.11
## O5   0.16  0.20  0.17  0.09  0.17  0.27  0.08  0.14 -0.02  0.07  0.14  0.09
## O6  -0.01  0.04  0.03  0.06 -0.08 -0.02 -0.04  0.05  0.17  0.05 -0.10 -0.06
## O7   0.04  0.08  0.07  0.08  0.01  0.05 -0.03  0.10  0.08  0.10 -0.04 -0.01
## O8  -0.11  0.04 -0.01  0.01 -0.07 -0.06 -0.03  0.09  0.13  0.15 -0.11 -0.07
## O9   0.00  0.06  0.09  0.03 -0.04  0.01 -0.08  0.00  0.08  0.12 -0.06 -0.02
## O10 -0.01 -0.03  0.01  0.04 -0.09  0.01  0.00  0.08  0.17  0.20 -0.13 -0.09
##        E3    E4    E5    E6    E7    E8    E9   E10    O1    O2    O3    O4
## A1   0.28  0.13  0.39  0.15 -0.08 -0.03 -0.11  0.02  0.08  0.18  0.20  0.12
## A2   0.36  0.35  0.43  0.29 -0.13 -0.13 -0.08  0.01  0.09  0.20  0.21  0.14
## A3   0.21  0.09  0.28  0.17 -0.10  0.05 -0.07  0.05  0.11  0.13  0.14  0.13
## A4   0.26  0.18  0.34  0.10 -0.09 -0.09 -0.15 -0.07  0.08  0.04  0.18 -0.01
## A5   0.29  0.24  0.41  0.18 -0.21 -0.25 -0.15 -0.10 -0.01  0.15  0.11  0.09
## A6   0.23  0.22  0.43  0.08 -0.08 -0.05 -0.14  0.10  0.08  0.26  0.24  0.14
## A7   0.15  0.19  0.19  0.12 -0.17 -0.11 -0.09 -0.06  0.06  0.04  0.16  0.02
## A8   0.03 -0.03 -0.06 -0.04  0.14  0.08  0.13  0.04  0.14  0.13  0.11  0.10
## A9  -0.14 -0.12 -0.15  0.01  0.24  0.22  0.15  0.10  0.09 -0.04  0.00  0.11
## A10  0.08  0.12 -0.05  0.07  0.17  0.07  0.15 -0.01  0.10 -0.04 -0.03  0.07
## E1   0.32  0.52  0.40  0.41 -0.10 -0.39 -0.07 -0.10  0.04  0.34  0.08  0.11
## E2   0.31  0.65  0.28  0.38 -0.02 -0.53  0.04 -0.20  0.07  0.26  0.11  0.11
## E3   1.00  0.29  0.53  0.32 -0.43 -0.06 -0.12  0.00  0.08  0.00  0.14 -0.04
## E4   0.29  1.00  0.20  0.34 -0.11 -0.55 -0.09 -0.22  0.02  0.19  0.09  0.07
## E5   0.53  0.20  1.00  0.31 -0.26 -0.07 -0.20 -0.01  0.09  0.07  0.25  0.09
## E6   0.32  0.34  0.31  1.00 -0.04 -0.14  0.03 -0.15  0.04 -0.02 -0.03  0.08
## E7  -0.43 -0.11 -0.26 -0.04  1.00  0.15  0.24  0.06  0.17  0.17  0.03  0.17
## E8  -0.06 -0.55 -0.07 -0.14  0.15  1.00  0.15  0.26  0.14 -0.12  0.07  0.10
## E9  -0.12 -0.09 -0.20  0.03  0.24  0.15  1.00  0.08  0.19  0.06  0.08  0.11
## E10  0.00 -0.22 -0.01 -0.15  0.06  0.26  0.08  1.00  0.08  0.07  0.06  0.06
## O1   0.08  0.02  0.09  0.04  0.17  0.14  0.19  0.08  1.00  0.07  0.28  0.41
## O2   0.00  0.19  0.07 -0.02  0.17 -0.12  0.06  0.07  0.07  1.00  0.26  0.33
## O3   0.14  0.09  0.25 -0.03  0.03  0.07  0.08  0.06  0.28  0.26  1.00  0.34
## O4  -0.04  0.07  0.09  0.08  0.17  0.10  0.11  0.06  0.41  0.33  0.34  1.00
## O5   0.04  0.06  0.15  0.01  0.09  0.13  0.07  0.11  0.31  0.37  0.38  0.51
## O6   0.09 -0.01  0.10  0.10  0.08  0.08  0.01 -0.03 -0.04 -0.24 -0.21 -0.18
## O7   0.15  0.02  0.08  0.20 -0.02  0.08  0.01  0.01 -0.14 -0.22 -0.35 -0.22
## O8   0.14 -0.03  0.11  0.17  0.00  0.13  0.12  0.02 -0.03 -0.44 -0.24 -0.21
## O9   0.24  0.02  0.08  0.21 -0.07  0.08  0.07  0.07 -0.01 -0.37 -0.20 -0.22
## O10  0.16 -0.04  0.12  0.10 -0.03  0.19  0.07  0.04  0.10 -0.41 -0.06 -0.13
##        O5    O6    O7    O8    O9   O10
## A1   0.16 -0.01  0.04 -0.11  0.00 -0.01
## A2   0.20  0.04  0.08  0.04  0.06 -0.03
## A3   0.17  0.03  0.07 -0.01  0.09  0.01
## A4   0.09  0.06  0.08  0.01  0.03  0.04
## A5   0.17 -0.08  0.01 -0.07 -0.04 -0.09
## A6   0.27 -0.02  0.05 -0.06  0.01  0.01
## A7   0.08 -0.04 -0.03 -0.03 -0.08  0.00
## A8   0.14  0.05  0.10  0.09  0.00  0.08
## A9  -0.02  0.17  0.08  0.13  0.08  0.17
## A10  0.07  0.05  0.10  0.15  0.12  0.20
## E1   0.14 -0.10 -0.04 -0.11 -0.06 -0.13
## E2   0.09 -0.06 -0.01 -0.07 -0.02 -0.09
## E3   0.04  0.09  0.15  0.14  0.24  0.16
## E4   0.06 -0.01  0.02 -0.03  0.02 -0.04
## E5   0.15  0.10  0.08  0.11  0.08  0.12
## E6   0.01  0.10  0.20  0.17  0.21  0.10
## E7   0.09  0.08 -0.02  0.00 -0.07 -0.03
## E8   0.13  0.08  0.08  0.13  0.08  0.19
## E9   0.07  0.01  0.01  0.12  0.07  0.07
## E10  0.11 -0.03  0.01  0.02  0.07  0.04
## O1   0.31 -0.04 -0.14 -0.03 -0.01  0.10
## O2   0.37 -0.24 -0.22 -0.44 -0.37 -0.41
## O3   0.38 -0.21 -0.35 -0.24 -0.20 -0.06
## O4   0.51 -0.18 -0.22 -0.21 -0.22 -0.13
## O5   1.00 -0.16 -0.14 -0.18 -0.16 -0.11
## O6  -0.16  1.00  0.50  0.47  0.33  0.26
## O7  -0.14  0.50  1.00  0.47  0.40  0.29
## O8  -0.18  0.47  0.47  1.00  0.60  0.47
## O9  -0.16  0.33  0.40  0.60  1.00  0.42
## O10 -0.11  0.26  0.29  0.47  0.42  1.00
Hmisc::rcorr(as.matrix(std_AEO))
##        A1    A2    A3    A4    A5    A6    A7    A8    A9   A10    E1    E2
## A1   1.00  0.39  0.56  0.43  0.42  0.45  0.31 -0.18 -0.30 -0.16  0.22  0.12
## A2   0.39  1.00  0.43  0.40  0.44  0.51  0.37 -0.17 -0.27 -0.08  0.36  0.37
## A3   0.56  0.43  1.00  0.33  0.30  0.44  0.41 -0.11 -0.28 -0.16  0.16  0.04
## A4   0.43  0.40  0.33  1.00  0.28  0.34  0.25 -0.24 -0.39 -0.18  0.18  0.15
## A5   0.42  0.44  0.30  0.28  1.00  0.46  0.26 -0.21 -0.37 -0.15  0.38  0.21
## A6   0.45  0.51  0.44  0.34  0.46  1.00  0.27 -0.09 -0.27 -0.07  0.29  0.20
## A7   0.31  0.37  0.41  0.25  0.26  0.27  1.00 -0.28 -0.28 -0.26  0.20  0.15
## A8  -0.18 -0.17 -0.11 -0.24 -0.21 -0.09 -0.28  1.00  0.30  0.24 -0.06  0.02
## A9  -0.30 -0.27 -0.28 -0.39 -0.37 -0.27 -0.28  0.30  1.00  0.30 -0.16 -0.10
## A10 -0.16 -0.08 -0.16 -0.18 -0.15 -0.07 -0.26  0.24  0.30  1.00 -0.03  0.09
## E1   0.22  0.36  0.16  0.18  0.38  0.29  0.20 -0.06 -0.16 -0.03  1.00  0.57
## E2   0.12  0.37  0.04  0.15  0.21  0.20  0.15  0.02 -0.10  0.09  0.57  1.00
## E3   0.28  0.36  0.21  0.26  0.29  0.23  0.15  0.03 -0.14  0.08  0.32  0.31
## E4   0.13  0.35  0.09  0.18  0.24  0.22  0.19 -0.03 -0.12  0.12  0.52  0.65
## E5   0.39  0.43  0.28  0.34  0.41  0.43  0.19 -0.06 -0.15 -0.05  0.40  0.28
## E6   0.15  0.29  0.17  0.10  0.18  0.08  0.12 -0.04  0.01  0.07  0.41  0.38
## E7  -0.08 -0.13 -0.10 -0.09 -0.21 -0.08 -0.17  0.14  0.24  0.17 -0.10 -0.02
## E8  -0.03 -0.13  0.05 -0.09 -0.25 -0.05 -0.11  0.08  0.22  0.07 -0.39 -0.53
## E9  -0.11 -0.08 -0.07 -0.15 -0.15 -0.14 -0.09  0.13  0.15  0.15 -0.07  0.04
## E10  0.02  0.01  0.05 -0.07 -0.10  0.10 -0.06  0.04  0.10 -0.01 -0.10 -0.20
## O1   0.08  0.09  0.11  0.08 -0.01  0.08  0.06  0.14  0.09  0.10  0.04  0.07
## O2   0.18  0.20  0.13  0.04  0.15  0.26  0.04  0.13 -0.04 -0.04  0.34  0.26
## O3   0.20  0.21  0.14  0.18  0.11  0.24  0.16  0.11  0.00 -0.03  0.08  0.11
## O4   0.12  0.14  0.13 -0.01  0.09  0.14  0.02  0.10  0.11  0.07  0.11  0.11
## O5   0.16  0.20  0.17  0.09  0.17  0.27  0.08  0.14 -0.02  0.07  0.14  0.09
## O6  -0.01  0.04  0.03  0.06 -0.08 -0.02 -0.04  0.05  0.17  0.05 -0.10 -0.06
## O7   0.04  0.08  0.07  0.08  0.01  0.05 -0.03  0.10  0.08  0.10 -0.04 -0.01
## O8  -0.11  0.04 -0.01  0.01 -0.07 -0.06 -0.03  0.09  0.13  0.15 -0.11 -0.07
## O9   0.00  0.06  0.09  0.03 -0.04  0.01 -0.08  0.00  0.08  0.12 -0.06 -0.02
## O10 -0.01 -0.03  0.01  0.04 -0.09  0.01  0.00  0.08  0.17  0.20 -0.13 -0.09
##        E3    E4    E5    E6    E7    E8    E9   E10    O1    O2    O3    O4
## A1   0.28  0.13  0.39  0.15 -0.08 -0.03 -0.11  0.02  0.08  0.18  0.20  0.12
## A2   0.36  0.35  0.43  0.29 -0.13 -0.13 -0.08  0.01  0.09  0.20  0.21  0.14
## A3   0.21  0.09  0.28  0.17 -0.10  0.05 -0.07  0.05  0.11  0.13  0.14  0.13
## A4   0.26  0.18  0.34  0.10 -0.09 -0.09 -0.15 -0.07  0.08  0.04  0.18 -0.01
## A5   0.29  0.24  0.41  0.18 -0.21 -0.25 -0.15 -0.10 -0.01  0.15  0.11  0.09
## A6   0.23  0.22  0.43  0.08 -0.08 -0.05 -0.14  0.10  0.08  0.26  0.24  0.14
## A7   0.15  0.19  0.19  0.12 -0.17 -0.11 -0.09 -0.06  0.06  0.04  0.16  0.02
## A8   0.03 -0.03 -0.06 -0.04  0.14  0.08  0.13  0.04  0.14  0.13  0.11  0.10
## A9  -0.14 -0.12 -0.15  0.01  0.24  0.22  0.15  0.10  0.09 -0.04  0.00  0.11
## A10  0.08  0.12 -0.05  0.07  0.17  0.07  0.15 -0.01  0.10 -0.04 -0.03  0.07
## E1   0.32  0.52  0.40  0.41 -0.10 -0.39 -0.07 -0.10  0.04  0.34  0.08  0.11
## E2   0.31  0.65  0.28  0.38 -0.02 -0.53  0.04 -0.20  0.07  0.26  0.11  0.11
## E3   1.00  0.29  0.53  0.32 -0.43 -0.06 -0.12  0.00  0.08  0.00  0.14 -0.04
## E4   0.29  1.00  0.20  0.34 -0.11 -0.55 -0.09 -0.22  0.02  0.19  0.09  0.07
## E5   0.53  0.20  1.00  0.31 -0.26 -0.07 -0.20 -0.01  0.09  0.07  0.25  0.09
## E6   0.32  0.34  0.31  1.00 -0.04 -0.14  0.03 -0.15  0.04 -0.02 -0.03  0.08
## E7  -0.43 -0.11 -0.26 -0.04  1.00  0.15  0.24  0.06  0.17  0.17  0.03  0.17
## E8  -0.06 -0.55 -0.07 -0.14  0.15  1.00  0.15  0.26  0.14 -0.12  0.07  0.10
## E9  -0.12 -0.09 -0.20  0.03  0.24  0.15  1.00  0.08  0.19  0.06  0.08  0.11
## E10  0.00 -0.22 -0.01 -0.15  0.06  0.26  0.08  1.00  0.08  0.07  0.06  0.06
## O1   0.08  0.02  0.09  0.04  0.17  0.14  0.19  0.08  1.00  0.07  0.28  0.41
## O2   0.00  0.19  0.07 -0.02  0.17 -0.12  0.06  0.07  0.07  1.00  0.26  0.33
## O3   0.14  0.09  0.25 -0.03  0.03  0.07  0.08  0.06  0.28  0.26  1.00  0.34
## O4  -0.04  0.07  0.09  0.08  0.17  0.10  0.11  0.06  0.41  0.33  0.34  1.00
## O5   0.04  0.06  0.15  0.01  0.09  0.13  0.07  0.11  0.31  0.37  0.38  0.51
## O6   0.09 -0.01  0.10  0.10  0.08  0.08  0.01 -0.03 -0.04 -0.24 -0.21 -0.18
## O7   0.15  0.02  0.08  0.20 -0.02  0.08  0.01  0.01 -0.14 -0.22 -0.35 -0.22
## O8   0.14 -0.03  0.11  0.17  0.00  0.13  0.12  0.02 -0.03 -0.44 -0.24 -0.21
## O9   0.24  0.02  0.08  0.21 -0.07  0.08  0.07  0.07 -0.01 -0.37 -0.20 -0.22
## O10  0.16 -0.04  0.12  0.10 -0.03  0.19  0.07  0.04  0.10 -0.41 -0.06 -0.13
##        O5    O6    O7    O8    O9   O10
## A1   0.16 -0.01  0.04 -0.11  0.00 -0.01
## A2   0.20  0.04  0.08  0.04  0.06 -0.03
## A3   0.17  0.03  0.07 -0.01  0.09  0.01
## A4   0.09  0.06  0.08  0.01  0.03  0.04
## A5   0.17 -0.08  0.01 -0.07 -0.04 -0.09
## A6   0.27 -0.02  0.05 -0.06  0.01  0.01
## A7   0.08 -0.04 -0.03 -0.03 -0.08  0.00
## A8   0.14  0.05  0.10  0.09  0.00  0.08
## A9  -0.02  0.17  0.08  0.13  0.08  0.17
## A10  0.07  0.05  0.10  0.15  0.12  0.20
## E1   0.14 -0.10 -0.04 -0.11 -0.06 -0.13
## E2   0.09 -0.06 -0.01 -0.07 -0.02 -0.09
## E3   0.04  0.09  0.15  0.14  0.24  0.16
## E4   0.06 -0.01  0.02 -0.03  0.02 -0.04
## E5   0.15  0.10  0.08  0.11  0.08  0.12
## E6   0.01  0.10  0.20  0.17  0.21  0.10
## E7   0.09  0.08 -0.02  0.00 -0.07 -0.03
## E8   0.13  0.08  0.08  0.13  0.08  0.19
## E9   0.07  0.01  0.01  0.12  0.07  0.07
## E10  0.11 -0.03  0.01  0.02  0.07  0.04
## O1   0.31 -0.04 -0.14 -0.03 -0.01  0.10
## O2   0.37 -0.24 -0.22 -0.44 -0.37 -0.41
## O3   0.38 -0.21 -0.35 -0.24 -0.20 -0.06
## O4   0.51 -0.18 -0.22 -0.21 -0.22 -0.13
## O5   1.00 -0.16 -0.14 -0.18 -0.16 -0.11
## O6  -0.16  1.00  0.50  0.47  0.33  0.26
## O7  -0.14  0.50  1.00  0.47  0.40  0.29
## O8  -0.18  0.47  0.47  1.00  0.60  0.47
## O9  -0.16  0.33  0.40  0.60  1.00  0.42
## O10 -0.11  0.26  0.29  0.47  0.42  1.00
## 
## n= 382 
## 
## 
## P
##     A1     A2     A3     A4     A5     A6     A7     A8     A9     A10   
## A1         0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0004 0.0000 0.0023
## A2  0.0000        0.0000 0.0000 0.0000 0.0000 0.0000 0.0008 0.0000 0.1215
## A3  0.0000 0.0000        0.0000 0.0000 0.0000 0.0000 0.0263 0.0000 0.0014
## A4  0.0000 0.0000 0.0000        0.0000 0.0000 0.0000 0.0000 0.0000 0.0005
## A5  0.0000 0.0000 0.0000 0.0000        0.0000 0.0000 0.0000 0.0000 0.0030
## A6  0.0000 0.0000 0.0000 0.0000 0.0000        0.0000 0.0667 0.0000 0.1764
## A7  0.0000 0.0000 0.0000 0.0000 0.0000 0.0000        0.0000 0.0000 0.0000
## A8  0.0004 0.0008 0.0263 0.0000 0.0000 0.0667 0.0000        0.0000 0.0000
## A9  0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000        0.0000
## A10 0.0023 0.1215 0.0014 0.0005 0.0030 0.1764 0.0000 0.0000 0.0000       
## E1  0.0000 0.0000 0.0023 0.0003 0.0000 0.0000 0.0001 0.2708 0.0018 0.5838
## E2  0.0231 0.0000 0.4290 0.0026 0.0000 0.0000 0.0035 0.6496 0.0459 0.0916
## E3  0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0024 0.5344 0.0047 0.1430
## E4  0.0136 0.0000 0.0959 0.0004 0.0000 0.0000 0.0002 0.5358 0.0172 0.0222
## E5  0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0003 0.2217 0.0025 0.2862
## E6  0.0025 0.0000 0.0011 0.0542 0.0003 0.1088 0.0222 0.3954 0.8100 0.1567
## E7  0.1106 0.0102 0.0429 0.0813 0.0000 0.1330 0.0008 0.0057 0.0000 0.0006
## E8  0.5017 0.0127 0.3520 0.0798 0.0000 0.2889 0.0348 0.1319 0.0000 0.1577
## E9  0.0287 0.1235 0.1881 0.0035 0.0043 0.0057 0.0717 0.0139 0.0027 0.0028
## E10 0.6691 0.8495 0.3647 0.1949 0.0541 0.0491 0.2741 0.4655 0.0492 0.8995
## O1  0.1121 0.0792 0.0354 0.1030 0.8085 0.1021 0.2092 0.0049 0.0898 0.0495
## O2  0.0005 0.0000 0.0143 0.4641 0.0030 0.0000 0.4932 0.0141 0.4371 0.4804
## O3  0.0000 0.0000 0.0050 0.0004 0.0341 0.0000 0.0021 0.0335 0.9593 0.5889
## O4  0.0159 0.0064 0.0134 0.7820 0.0664 0.0049 0.6429 0.0464 0.0359 0.1692
## O5  0.0023 0.0000 0.0010 0.0758 0.0007 0.0000 0.1059 0.0063 0.6362 0.1816
## O6  0.8157 0.4647 0.5769 0.2564 0.1108 0.6307 0.4799 0.3270 0.0006 0.3676
## O7  0.4925 0.1228 0.1835 0.1203 0.8227 0.2837 0.5634 0.0453 0.1398 0.0403
## O8  0.0338 0.3911 0.8716 0.9152 0.1695 0.2483 0.5334 0.0909 0.0135 0.0039
## O9  0.9410 0.2090 0.0770 0.5057 0.3861 0.7737 0.1019 0.9566 0.1191 0.0166
## O10 0.9156 0.5071 0.8137 0.4404 0.0759 0.8476 0.9957 0.0988 0.0009 0.0001
##     E1     E2     E3     E4     E5     E6     E7     E8     E9     E10   
## A1  0.0000 0.0231 0.0000 0.0136 0.0000 0.0025 0.1106 0.5017 0.0287 0.6691
## A2  0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0102 0.0127 0.1235 0.8495
## A3  0.0023 0.4290 0.0000 0.0959 0.0000 0.0011 0.0429 0.3520 0.1881 0.3647
## A4  0.0003 0.0026 0.0000 0.0004 0.0000 0.0542 0.0813 0.0798 0.0035 0.1949
## A5  0.0000 0.0000 0.0000 0.0000 0.0000 0.0003 0.0000 0.0000 0.0043 0.0541
## A6  0.0000 0.0000 0.0000 0.0000 0.0000 0.1088 0.1330 0.2889 0.0057 0.0491
## A7  0.0001 0.0035 0.0024 0.0002 0.0003 0.0222 0.0008 0.0348 0.0717 0.2741
## A8  0.2708 0.6496 0.5344 0.5358 0.2217 0.3954 0.0057 0.1319 0.0139 0.4655
## A9  0.0018 0.0459 0.0047 0.0172 0.0025 0.8100 0.0000 0.0000 0.0027 0.0492
## A10 0.5838 0.0916 0.1430 0.0222 0.2862 0.1567 0.0006 0.1577 0.0028 0.8995
## E1         0.0000 0.0000 0.0000 0.0000 0.0000 0.0624 0.0000 0.1438 0.0606
## E2  0.0000        0.0000 0.0000 0.0000 0.0000 0.6479 0.0000 0.4709 0.0000
## E3  0.0000 0.0000        0.0000 0.0000 0.0000 0.0000 0.2091 0.0156 0.9592
## E4  0.0000 0.0000 0.0000        0.0001 0.0000 0.0274 0.0000 0.0653 0.0000
## E5  0.0000 0.0000 0.0000 0.0001        0.0000 0.0000 0.1619 0.0001 0.8689
## E6  0.0000 0.0000 0.0000 0.0000 0.0000        0.4142 0.0046 0.5459 0.0040
## E7  0.0624 0.6479 0.0000 0.0274 0.0000 0.4142        0.0028 0.0000 0.2656
## E8  0.0000 0.0000 0.2091 0.0000 0.1619 0.0046 0.0028        0.0029 0.0000
## E9  0.1438 0.4709 0.0156 0.0653 0.0001 0.5459 0.0000 0.0029        0.1054
## E10 0.0606 0.0000 0.9592 0.0000 0.8689 0.0040 0.2656 0.0000 0.1054       
## O1  0.4575 0.1436 0.1264 0.6898 0.0813 0.4095 0.0008 0.0063 0.0001 0.1218
## O2  0.0000 0.0000 0.9252 0.0001 0.1813 0.6935 0.0010 0.0176 0.2352 0.1830
## O3  0.1023 0.0259 0.0049 0.0794 0.0000 0.5987 0.6129 0.1853 0.0983 0.2632
## O4  0.0271 0.0293 0.4556 0.2045 0.0770 0.1100 0.0010 0.0581 0.0396 0.2124
## O5  0.0047 0.0665 0.4175 0.2669 0.0027 0.8687 0.0707 0.0093 0.1657 0.0296
## O6  0.0521 0.2105 0.0919 0.8051 0.0434 0.0586 0.1222 0.1359 0.8497 0.5962
## O7  0.4783 0.7911 0.0042 0.7669 0.1138 0.0001 0.7446 0.1170 0.8768 0.8659
## O8  0.0293 0.1947 0.0062 0.5721 0.0294 0.0006 0.9588 0.0136 0.0179 0.6887
## O9  0.2474 0.7180 0.0000 0.7038 0.1173 0.0000 0.1452 0.1159 0.1562 0.1546
## O10 0.0110 0.0954 0.0018 0.4578 0.0213 0.0472 0.5176 0.0001 0.1568 0.4204
##     O1     O2     O3     O4     O5     O6     O7     O8     O9     O10   
## A1  0.1121 0.0005 0.0000 0.0159 0.0023 0.8157 0.4925 0.0338 0.9410 0.9156
## A2  0.0792 0.0000 0.0000 0.0064 0.0000 0.4647 0.1228 0.3911 0.2090 0.5071
## A3  0.0354 0.0143 0.0050 0.0134 0.0010 0.5769 0.1835 0.8716 0.0770 0.8137
## A4  0.1030 0.4641 0.0004 0.7820 0.0758 0.2564 0.1203 0.9152 0.5057 0.4404
## A5  0.8085 0.0030 0.0341 0.0664 0.0007 0.1108 0.8227 0.1695 0.3861 0.0759
## A6  0.1021 0.0000 0.0000 0.0049 0.0000 0.6307 0.2837 0.2483 0.7737 0.8476
## A7  0.2092 0.4932 0.0021 0.6429 0.1059 0.4799 0.5634 0.5334 0.1019 0.9957
## A8  0.0049 0.0141 0.0335 0.0464 0.0063 0.3270 0.0453 0.0909 0.9566 0.0988
## A9  0.0898 0.4371 0.9593 0.0359 0.6362 0.0006 0.1398 0.0135 0.1191 0.0009
## A10 0.0495 0.4804 0.5889 0.1692 0.1816 0.3676 0.0403 0.0039 0.0166 0.0001
## E1  0.4575 0.0000 0.1023 0.0271 0.0047 0.0521 0.4783 0.0293 0.2474 0.0110
## E2  0.1436 0.0000 0.0259 0.0293 0.0665 0.2105 0.7911 0.1947 0.7180 0.0954
## E3  0.1264 0.9252 0.0049 0.4556 0.4175 0.0919 0.0042 0.0062 0.0000 0.0018
## E4  0.6898 0.0001 0.0794 0.2045 0.2669 0.8051 0.7669 0.5721 0.7038 0.4578
## E5  0.0813 0.1813 0.0000 0.0770 0.0027 0.0434 0.1138 0.0294 0.1173 0.0213
## E6  0.4095 0.6935 0.5987 0.1100 0.8687 0.0586 0.0001 0.0006 0.0000 0.0472
## E7  0.0008 0.0010 0.6129 0.0010 0.0707 0.1222 0.7446 0.9588 0.1452 0.5176
## E8  0.0063 0.0176 0.1853 0.0581 0.0093 0.1359 0.1170 0.0136 0.1159 0.0001
## E9  0.0001 0.2352 0.0983 0.0396 0.1657 0.8497 0.8768 0.0179 0.1562 0.1568
## E10 0.1218 0.1830 0.2632 0.2124 0.0296 0.5962 0.8659 0.6887 0.1546 0.4204
## O1         0.1520 0.0000 0.0000 0.0000 0.4146 0.0047 0.5479 0.8552 0.0594
## O2  0.1520        0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
## O3  0.0000 0.0000        0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.2722
## O4  0.0000 0.0000 0.0000        0.0000 0.0005 0.0000 0.0000 0.0000 0.0097
## O5  0.0000 0.0000 0.0000 0.0000        0.0022 0.0077 0.0004 0.0021 0.0347
## O6  0.4146 0.0000 0.0000 0.0005 0.0022        0.0000 0.0000 0.0000 0.0000
## O7  0.0047 0.0000 0.0000 0.0000 0.0077 0.0000        0.0000 0.0000 0.0000
## O8  0.5479 0.0000 0.0000 0.0000 0.0004 0.0000 0.0000        0.0000 0.0000
## O9  0.8552 0.0000 0.0000 0.0000 0.0021 0.0000 0.0000 0.0000        0.0000
## O10 0.0594 0.0000 0.2722 0.0097 0.0347 0.0000 0.0000 0.0000 0.0000
pMat <- ggcorrplot::cor_pmat(std_AEO)
ggcorrplot::ggcorrplot(perstdMatrix_AEO, tl.cex = 8, title="Correlation Matric for Stduent Personality data (A,E,O)") + theme(axis.text.x = element_text(margin=ggplot2::margin(-2,0,0,0)),
        axis.text.y = element_text(margin=ggplot2::margin(0,-2,0,0)),
        panel.grid.minor = element_line(size=10))

#Showing X for non-significant correlations
ggcorrplot::ggcorrplot(perstdMatrix_AEO, tl.cex = 8, title = "Correlation matrix for Stduent Personality data (A,E,O)", p.mat = pMat, sig.level = 0.05)

#Showing lower diagonal
ggcorrplot::ggcorrplot(perstdMatrix_AEO, tl.cex = 8, title = "Correlation matrix for Stduent Personality data (A,E,O)", p.mat =  pMat, sig.level = 0.05, type="lower")

#Overlay plot with a white grid to space things out for non-significant correlations
ggcorrplot(perstdMatrix_AEO, sig.level=0.05, lab_size = 4.5, p.mat = NULL,
           insig = c("pch", "blank"), pch = 1, pch.col = "black", pch.cex =1,
           tl.cex = 8) +
  theme(axis.text.x = element_text(margin=ggplot2::margin(-2,0,0,0)),
        axis.text.y = element_text(margin=ggplot2::margin(0,-2,0,0)),
        panel.grid.minor = element_line(size=10)) + 
  geom_tile(fill="white") +
  geom_tile(height=0.8, width=0.8)

#Showing the co-coefficients (this will be messy given the number of variables)
ggcorrplot::ggcorrplot(perstdMatrix_AEO, lab=TRUE, title = "Correlation matrix for Stduent Personality data (A,E,O)",  type="lower")

#Visualization of correlations using shade
#corrplot parameters method = c("circle", "square", "ellipse", "number", "shade",
#"color", "pie")
#type = c("full", "lower", "upper"),

corrplot::corrplot(perstdMatrix_AEO, method="ellipse")

corrplot::corrplot(perstdMatrix_AEO, method="circle", type="upper")

corrplot::corrplot(perstdMatrix_AEO, method="number")

#About significance level at 0.05, and Non-significant 

res_max_AEO <- corrplot::cor.mtest(perstdMatrix_AEO, conf.level = .95)
res_max_AEO
## $p
##               [,1]         [,2]         [,3]         [,4]         [,5]
##  [1,] 0.000000e+00 5.504347e-07 4.391808e-10 1.341975e-07 1.631543e-07
##  [2,] 5.504347e-07 0.000000e+00 2.782554e-06 5.688783e-07 4.798226e-09
##  [3,] 4.391808e-10 2.782554e-06 0.000000e+00 1.117157e-05 3.015084e-05
##  [4,] 1.341975e-07 5.688783e-07 1.117157e-05 0.000000e+00 1.122540e-05
##  [5,] 1.631543e-07 4.798226e-09 3.015084e-05 1.122540e-05 0.000000e+00
##  [6,] 2.710448e-08 1.068455e-08 6.381878e-07 7.136243e-06 1.208482e-08
##  [7,] 9.868634e-06 2.165878e-06 1.268635e-06 5.300317e-05 3.294970e-05
##  [8,] 9.383381e-05 6.708039e-05 3.249203e-04 2.252491e-05 1.696491e-04
##  [9,] 3.032036e-08 1.492202e-08 3.535772e-07 3.991416e-09 6.300134e-09
## [10,] 6.733287e-05 8.084840e-04 5.167581e-05 2.196294e-04 7.373562e-04
## [11,] 4.925545e-03 1.586194e-05 4.528479e-02 8.329184e-03 7.781357e-06
## [12,] 1.030871e-01 5.359847e-04 3.667632e-01 5.629253e-02 2.375918e-03
## [13,] 4.822223e-03 1.847247e-04 1.886750e-02 1.625082e-03 4.814029e-04
## [14,] 6.701226e-02 2.400931e-04 2.216088e-01 2.608265e-02 1.022558e-03
## [15,] 1.440087e-05 7.172518e-07 6.589347e-04 2.040749e-05 5.105688e-07
## [16,] 2.123642e-01 1.137957e-02 2.855631e-01 1.513330e-01 2.901824e-02
## [17,] 3.980168e-03 3.582018e-04 4.753370e-03 2.486038e-03 3.184991e-04
## [18,] 5.583546e-02 7.209200e-04 2.274162e-01 2.574517e-02 4.103455e-04
## [19,] 1.074362e-03 7.147006e-04 4.643191e-03 7.373452e-04 5.582033e-04
## [20,] 3.548733e-01 9.277706e-02 5.559354e-01 1.289755e-01 6.480022e-02
## [21,] 7.718206e-01 5.248358e-01 8.213617e-01 6.139377e-01 4.225383e-01
## [22,] 8.538797e-02 7.695936e-02 2.611049e-01 4.825464e-01 5.604060e-02
## [23,] 5.358152e-02 1.084108e-01 1.549420e-01 1.736191e-01 1.314766e-01
## [24,] 5.605518e-01 7.261162e-01 7.124093e-01 6.764740e-01 6.325799e-01
## [25,] 1.868381e-01 2.660175e-01 2.631936e-01 6.126443e-01 1.895497e-01
## [26,] 1.035506e-01 1.470258e-01 2.469688e-01 4.909143e-01 7.152553e-02
## [27,] 2.653185e-01 3.916392e-01 5.016447e-01 7.505951e-01 3.029456e-01
## [28,] 3.060052e-02 9.984162e-02 1.431717e-01 2.903104e-01 4.939281e-02
## [29,] 1.717176e-01 3.093329e-01 4.606382e-01 6.061081e-01 1.763684e-01
## [30,] 6.628234e-02 4.416878e-02 1.690011e-01 3.173599e-01 3.012342e-02
##               [,6]         [,7]         [,8]         [,9]        [,10]
##  [1,] 2.710448e-08 9.868634e-06 9.383381e-05 3.032036e-08 6.733287e-05
##  [2,] 1.068455e-08 2.165878e-06 6.708039e-05 1.492202e-08 8.084840e-04
##  [3,] 6.381878e-07 1.268635e-06 3.249203e-04 3.535772e-07 5.167581e-05
##  [4,] 7.136243e-06 5.300317e-05 2.252491e-05 3.991416e-09 2.196294e-04
##  [5,] 1.208482e-08 3.294970e-05 1.696491e-04 6.300134e-09 7.373562e-04
##  [6,] 0.000000e+00 6.495440e-05 1.050475e-03 8.133032e-08 7.167675e-04
##  [7,] 6.495440e-05 0.000000e+00 1.293389e-05 7.748611e-07 2.080280e-05
##  [8,] 1.050475e-03 1.293389e-05 0.000000e+00 6.101424e-05 1.464676e-03
##  [9,] 8.133032e-08 7.748611e-07 6.101424e-05 0.000000e+00 1.086680e-04
## [10,] 7.167675e-04 2.080280e-05 1.464676e-03 1.086680e-04 0.000000e+00
## [11,] 8.781252e-04 5.157426e-03 3.082872e-02 4.738552e-04 6.520207e-02
## [12,] 3.009594e-02 4.490581e-02 1.897742e-01 1.225587e-02 4.621570e-01
## [13,] 7.069688e-03 1.832264e-02 4.538177e-02 1.354429e-03 1.676813e-01
## [14,] 1.805569e-02 1.868581e-02 9.107936e-02 6.001965e-03 4.571562e-01
## [15,] 5.535000e-06 1.438680e-03 3.708493e-03 3.691793e-05 7.734474e-03
## [16,] 3.450750e-01 1.451274e-01 7.404810e-02 1.032365e-01 5.929026e-01
## [17,] 4.333097e-03 2.053054e-03 2.149661e-02 1.253611e-03 4.317672e-02
## [18,] 2.067321e-02 1.981231e-02 1.260462e-01 5.748614e-03 2.970802e-01
## [19,] 4.290536e-04 6.280721e-03 3.150835e-02 4.966822e-03 3.838665e-02
## [20,] 5.073137e-01 1.624956e-01 4.867809e-01 2.016888e-01 9.696611e-01
## [21,] 7.561117e-01 7.563079e-01 3.185340e-01 5.785012e-01 7.819919e-01
## [22,] 1.926998e-02 2.883082e-01 9.505534e-01 1.252769e-01 1.757589e-01
## [23,] 2.761958e-02 1.164382e-01 7.988963e-01 1.549538e-01 1.219640e-01
## [24,] 3.896448e-01 8.929203e-01 5.655442e-01 9.801195e-01 7.372727e-01
## [25,] 4.795904e-02 4.345925e-01 8.246451e-01 2.721989e-01 3.634062e-01
## [26,] 4.737378e-02 1.564316e-01 7.608188e-01 1.265031e-01 4.100636e-01
## [27,] 1.874755e-01 2.709774e-01 9.016666e-01 4.494210e-01 4.081194e-01
## [28,] 1.875137e-02 1.134749e-01 6.414055e-01 1.196406e-01 1.430166e-01
## [29,] 1.060368e-01 2.022507e-01 8.932577e-01 3.573646e-01 2.676161e-01
## [30,] 3.326884e-02 1.385428e-01 5.420068e-01 7.701168e-02 8.580533e-02
##              [,11]        [,12]        [,13]        [,14]        [,15]
##  [1,] 4.925545e-03 1.030871e-01 4.822223e-03 6.701226e-02 1.440087e-05
##  [2,] 1.586194e-05 5.359847e-04 1.847247e-04 2.400931e-04 7.172518e-07
##  [3,] 4.528479e-02 3.667632e-01 1.886750e-02 2.216088e-01 6.589347e-04
##  [4,] 8.329184e-03 5.629253e-02 1.625082e-03 2.608265e-02 2.040749e-05
##  [5,] 7.781357e-06 2.375918e-03 4.814029e-04 1.022558e-03 5.105688e-07
##  [6,] 8.781252e-04 3.009594e-02 7.069688e-03 1.805569e-02 5.535000e-06
##  [7,] 5.157426e-03 4.490581e-02 1.832264e-02 1.868581e-02 1.438680e-03
##  [8,] 3.082872e-02 1.897742e-01 4.538177e-02 9.107936e-02 3.708493e-03
##  [9,] 4.738552e-04 1.225587e-02 1.354429e-03 6.001965e-03 3.691793e-05
## [10,] 6.520207e-02 4.621570e-01 1.676813e-01 4.571562e-01 7.734474e-03
## [11,] 0.000000e+00 1.797151e-10 1.262540e-03 1.858329e-09 9.930986e-05
## [12,] 1.797151e-10 0.000000e+00 5.863092e-03 6.120789e-14 6.191882e-03
## [13,] 1.262540e-03 5.863092e-03 0.000000e+00 2.576874e-03 3.767340e-08
## [14,] 1.858329e-09 6.120789e-14 2.576874e-03 0.000000e+00 5.372016e-03
## [15,] 9.930986e-05 6.191882e-03 3.767340e-08 5.372016e-03 0.000000e+00
## [16,] 2.323897e-04 2.451425e-04 1.183906e-03 2.170825e-04 4.972471e-03
## [17,] 1.072206e-02 6.410554e-02 3.112729e-10 1.754994e-02 1.719929e-06
## [18,] 4.346964e-09 1.498205e-12 9.946997e-03 9.373691e-14 8.065684e-03
## [19,] 1.058960e-02 1.081299e-01 9.207503e-04 2.260795e-02 3.775302e-05
## [20,] 9.793107e-03 9.713337e-04 9.711614e-02 5.161299e-04 1.072858e-01
## [21,] 5.205232e-01 6.577608e-01 2.467267e-01 3.833945e-01 4.538421e-01
## [22,] 3.255580e-03 1.691639e-02 7.251610e-01 6.376286e-02 4.973528e-01
## [23,] 2.152283e-01 3.309055e-01 7.480777e-01 5.196893e-01 1.494924e-01
## [24,] 4.554373e-01 5.723150e-01 1.635968e-01 9.252130e-01 8.181193e-01
## [25,] 2.939411e-01 5.758748e-01 5.192902e-01 8.510021e-01 5.910189e-01
## [26,] 2.607947e-02 7.530589e-02 9.977001e-01 1.891053e-01 5.161689e-01
## [27,] 1.258270e-01 2.101436e-01 4.948236e-01 4.244176e-01 7.852834e-01
## [28,] 1.514030e-02 6.190711e-02 7.417603e-01 1.516430e-01 4.720934e-01
## [29,] 7.175189e-02 1.657445e-01 2.706078e-01 3.544423e-01 8.115429e-01
## [30,] 4.360658e-03 2.107310e-02 7.632926e-01 6.689155e-02 4.985996e-01
##              [,16]        [,17]        [,18]        [,19]        [,20]
##  [1,] 0.2123642466 3.980168e-03 5.583546e-02 1.074362e-03 0.3548732641
##  [2,] 0.0113795677 3.582018e-04 7.209200e-04 7.147006e-04 0.0927770631
##  [3,] 0.2855630860 4.753370e-03 2.274162e-01 4.643191e-03 0.5559353581
##  [4,] 0.1513329505 2.486038e-03 2.574517e-02 7.373452e-04 0.1289754893
##  [5,] 0.0290182400 3.184991e-04 4.103455e-04 5.582033e-04 0.0648002181
##  [6,] 0.3450750027 4.333097e-03 2.067321e-02 4.290536e-04 0.5073136817
##  [7,] 0.1451274056 2.053054e-03 1.981231e-02 6.280721e-03 0.1624955812
##  [8,] 0.0740481010 2.149661e-02 1.260462e-01 3.150835e-02 0.4867808504
##  [9,] 0.1032364658 1.253611e-03 5.748614e-03 4.966822e-03 0.2016888222
## [10,] 0.5929025751 4.317672e-02 2.970802e-01 3.838665e-02 0.9696611081
## [11,] 0.0002323897 1.072206e-02 4.346964e-09 1.058960e-02 0.0097931067
## [12,] 0.0002451425 6.410554e-02 1.498205e-12 1.081299e-01 0.0009713337
## [13,] 0.0011839058 3.112729e-10 9.946997e-03 9.207503e-04 0.0971161368
## [14,] 0.0002170825 1.754994e-02 9.373691e-14 2.260795e-02 0.0005161299
## [15,] 0.0049724707 1.719929e-06 8.065684e-03 3.775302e-05 0.1072858266
## [16,] 0.0000000000 1.709817e-02 8.758517e-04 1.094652e-01 0.0019394834
## [17,] 0.0170981653 0.000000e+00 4.299061e-02 1.497329e-03 0.3124203199
## [18,] 0.0008758517 4.299061e-02 0.000000e+00 4.248149e-02 0.0015320582
## [19,] 0.1094651913 1.497329e-03 4.248149e-02 0.000000e+00 0.3027116230
## [20,] 0.0019394834 3.124203e-01 1.532058e-03 3.027116e-01 0.0000000000
## [21,] 0.1693933265 1.463858e-01 2.774369e-01 1.446993e-01 0.5470435732
## [22,] 0.6445814179 5.547493e-01 5.186316e-02 6.556895e-01 0.8579985387
## [23,] 0.2817747334 7.713807e-01 6.754900e-01 7.005500e-01 0.8909780981
## [24,] 0.3215109039 1.688657e-01 9.079266e-01 5.658625e-01 0.7148151662
## [25,] 0.1992179177 6.246838e-01 9.681859e-01 8.916058e-01 0.5778494810
## [26,] 0.6985257161 9.812242e-01 2.874717e-01 9.864706e-01 0.7066986016
## [27,] 0.2646724438 4.166000e-01 5.377620e-01 6.906983e-01 0.6572440070
## [28,] 0.4661421329 6.644153e-01 1.834141e-01 5.620122e-01 0.9168302586
## [29,] 0.2382065073 2.649518e-01 3.724335e-01 9.092432e-01 0.9985967267
## [30,] 0.9439210804 6.165620e-01 4.998088e-02 6.155186e-01 0.8219532157
##              [,21]        [,22]        [,23]        [,24]        [,25]
##  [1,] 0.7718206124 8.538797e-02 5.358152e-02 5.605518e-01 1.868381e-01
##  [2,] 0.5248357767 7.695936e-02 1.084108e-01 7.261162e-01 2.660175e-01
##  [3,] 0.8213617182 2.611049e-01 1.549420e-01 7.124093e-01 2.631936e-01
##  [4,] 0.6139377402 4.825464e-01 1.736191e-01 6.764740e-01 6.126443e-01
##  [5,] 0.4225383440 5.604060e-02 1.314766e-01 6.325799e-01 1.895497e-01
##  [6,] 0.7561117005 1.926998e-02 2.761958e-02 3.896448e-01 4.795904e-02
##  [7,] 0.7563079453 2.883082e-01 1.164382e-01 8.929203e-01 4.345925e-01
##  [8,] 0.3185340295 9.505534e-01 7.988963e-01 5.655442e-01 8.246451e-01
##  [9,] 0.5785012483 1.252769e-01 1.549538e-01 9.801195e-01 2.721989e-01
## [10,] 0.7819919258 1.757589e-01 1.219640e-01 7.372727e-01 3.634062e-01
## [11,] 0.5205231892 3.255580e-03 2.152283e-01 4.554373e-01 2.939411e-01
## [12,] 0.6577608463 1.691639e-02 3.309055e-01 5.723150e-01 5.758748e-01
## [13,] 0.2467267319 7.251610e-01 7.480777e-01 1.635968e-01 5.192902e-01
## [14,] 0.3833944524 6.376286e-02 5.196893e-01 9.252130e-01 8.510021e-01
## [15,] 0.4538420829 4.973528e-01 1.494924e-01 8.181193e-01 5.910189e-01
## [16,] 0.1693933265 6.445814e-01 2.817747e-01 3.215109e-01 1.992179e-01
## [17,] 0.1463857591 5.547493e-01 7.713807e-01 1.688657e-01 6.246838e-01
## [18,] 0.2774368677 5.186316e-02 6.754900e-01 9.079266e-01 9.681859e-01
## [19,] 0.1446993443 6.556895e-01 7.005500e-01 5.658625e-01 8.916058e-01
## [20,] 0.5470435732 8.579985e-01 8.909781e-01 7.148152e-01 5.778495e-01
## [21,] 0.0000000000 2.468548e-01 6.247771e-03 1.238099e-04 3.494141e-03
## [22,] 0.2468548375 0.000000e+00 4.873221e-04 9.086366e-05 2.985418e-05
## [23,] 0.0062477706 4.873221e-04 0.000000e+00 7.342768e-05 9.360070e-06
## [24,] 0.0001238099 9.086366e-05 7.342768e-05 0.000000e+00 2.749181e-08
## [25,] 0.0034941405 2.985418e-05 9.360070e-06 2.749181e-08 0.000000e+00
## [26,] 0.0316785068 5.034196e-06 1.395881e-05 5.999964e-05 4.250730e-05
## [27,] 0.0022147227 1.235149e-05 5.092240e-08 3.906834e-06 3.085842e-05
## [28,] 0.0537407581 4.301123e-11 5.064473e-06 1.181223e-05 9.142041e-06
## [29,] 0.0510468375 6.566364e-09 3.151473e-05 9.427344e-06 2.519968e-05
## [30,] 0.3886450575 1.983525e-10 3.288311e-03 7.025876e-04 5.149381e-04
##              [,26]        [,27]        [,28]        [,29]        [,30]
##  [1,] 1.035506e-01 2.653185e-01 3.060052e-02 1.717176e-01 6.628234e-02
##  [2,] 1.470258e-01 3.916392e-01 9.984162e-02 3.093329e-01 4.416878e-02
##  [3,] 2.469688e-01 5.016447e-01 1.431717e-01 4.606382e-01 1.690011e-01
##  [4,] 4.909143e-01 7.505951e-01 2.903104e-01 6.061081e-01 3.173599e-01
##  [5,] 7.152553e-02 3.029456e-01 4.939281e-02 1.763684e-01 3.012342e-02
##  [6,] 4.737378e-02 1.874755e-01 1.875137e-02 1.060368e-01 3.326884e-02
##  [7,] 1.564316e-01 2.709774e-01 1.134749e-01 2.022507e-01 1.385428e-01
##  [8,] 7.608188e-01 9.016666e-01 6.414055e-01 8.932577e-01 5.420068e-01
##  [9,] 1.265031e-01 4.494210e-01 1.196406e-01 3.573646e-01 7.701168e-02
## [10,] 4.100636e-01 4.081194e-01 1.430166e-01 2.676161e-01 8.580533e-02
## [11,] 2.607947e-02 1.258270e-01 1.514030e-02 7.175189e-02 4.360658e-03
## [12,] 7.530589e-02 2.101436e-01 6.190711e-02 1.657445e-01 2.107310e-02
## [13,] 9.977001e-01 4.948236e-01 7.417603e-01 2.706078e-01 7.632926e-01
## [14,] 1.891053e-01 4.244176e-01 1.516430e-01 3.544423e-01 6.689155e-02
## [15,] 5.161689e-01 7.852834e-01 4.720934e-01 8.115429e-01 4.985996e-01
## [16,] 6.985257e-01 2.646724e-01 4.661421e-01 2.382065e-01 9.439211e-01
## [17,] 9.812242e-01 4.166000e-01 6.644153e-01 2.649518e-01 6.165620e-01
## [18,] 2.874717e-01 5.377620e-01 1.834141e-01 3.724335e-01 4.998088e-02
## [19,] 9.864706e-01 6.906983e-01 5.620122e-01 9.092432e-01 6.155186e-01
## [20,] 7.066986e-01 6.572440e-01 9.168303e-01 9.985967e-01 8.219532e-01
## [21,] 3.167851e-02 2.214723e-03 5.374076e-02 5.104684e-02 3.886451e-01
## [22,] 5.034196e-06 1.235149e-05 4.301123e-11 6.566364e-09 1.983525e-10
## [23,] 1.395881e-05 5.092240e-08 5.064473e-06 3.151473e-05 3.288311e-03
## [24,] 5.999964e-05 3.906834e-06 1.181223e-05 9.427344e-06 7.025876e-04
## [25,] 4.250730e-05 3.085842e-05 9.142041e-06 2.519968e-05 5.149381e-04
## [26,] 0.000000e+00 1.276691e-08 4.840914e-08 9.572729e-06 2.098205e-04
## [27,] 1.276691e-08 0.000000e+00 5.241753e-08 7.802251e-07 2.485500e-04
## [28,] 4.840914e-08 5.241753e-08 0.000000e+00 7.990401e-12 3.915216e-08
## [29,] 9.572729e-06 7.802251e-07 7.990401e-12 0.000000e+00 5.698019e-07
## [30,] 2.098205e-04 2.485500e-04 3.915216e-08 5.698019e-07 0.000000e+00
## 
## $lowCI
##               [,1]        [,2]         [,3]         [,4]         [,5]
##  [1,]  1.000000000  0.57221780  0.741963663  0.613016108  0.607613707
##  [2,]  0.572217798  1.00000000  0.519890076  0.571214246  0.694375190
##  [3,]  0.741963663  0.51989008  1.000000000  0.469703444  0.430474504
##  [4,]  0.613016108  0.57121425  0.469703444  1.000000000  0.469520623
##  [5,]  0.607613707  0.69437519  0.430474504  0.469520623  1.000000000
##  [6,]  0.654504443  0.67655068  0.567694665  0.486461630  0.673717448
##  [7,]  0.474397410  0.52839469  0.546032573  0.406802756  0.426818506
##  [8,] -0.819890213 -0.82555129 -0.796675916 -0.842430517 -0.809293281
##  [9,] -0.910889516 -0.91590080 -0.890663612 -0.924396030 -0.921570177
## [10,] -0.825489231 -0.77695579 -0.829791792 -0.804410845 -0.779066839
## [11,]  0.170098622  0.45619253  0.009147698  0.135622992  0.483269726
## [12,] -0.063807442  0.29763180 -0.201867074 -0.009245082  0.214987727
## [13,]  0.171450640  0.35048083  0.077827065  0.237149430  0.303179542
## [14,] -0.024421253  0.33790975 -0.142123110  0.053336652  0.263142865
## [15,]  0.459953137  0.56408874  0.286817835  0.446254457  0.574498065
## [16,] -0.137417375  0.11420036 -0.171170849 -0.101559482  0.045047402
## [17,] -0.735246570 -0.79468498 -0.729891312 -0.748686373 -0.797080157
## [18,] -0.632663667 -0.77957929 -0.542970186 -0.668919514 -0.791865231
## [19,] -0.770253743 -0.77977581 -0.730608257 -0.779067179 -0.785278723
## [20,] -0.503556078 -0.60464332 -0.453898701 -0.584110183 -0.624848733
## [21,] -0.407412129 -0.46101193 -0.397145645 -0.440988810 -0.485700795
## [22,] -0.046230306 -0.03677119 -0.160697429 -0.238422853 -0.008859895
## [23,] -0.005020802 -0.06860563 -0.103970618 -0.115781835 -0.087405006
## [24,] -0.259996118 -0.30078025 -0.297595019 -0.427474465 -0.278421704
## [25,] -0.123550679 -0.16285744 -0.161619450 -0.273442531 -0.125090947
## [26,] -0.598026205 -0.57532584 -0.536223170 -0.468955993 -0.619490719
## [27,] -0.530171535 -0.49366766 -0.466420249 -0.411836770 -0.518469880
## [28,] -0.661395920 -0.60024747 -0.577138487 -0.522303499 -0.638873912
## [29,] -0.564394054 -0.51656532 -0.476236813 -0.442707817 -0.562451118
## [30,] -0.623634355 -0.64436998 -0.565544592 -0.514201882 -0.662092535
##               [,6]         [,7]        [,8]        [,9]       [,10]
##  [1,]  0.654504443  0.474397410 -0.81989021 -0.91088952 -0.82548923
##  [2,]  0.676550680  0.528394690 -0.82555129 -0.91590080 -0.77695579
##  [3,]  0.567694665  0.546032573 -0.79667592 -0.89066361 -0.82979179
##  [4,]  0.486461630  0.406802756 -0.84243052 -0.92439603 -0.80441085
##  [5,]  0.673717448  0.426818506 -0.80929328 -0.92157018 -0.77906684
##  [6,]  1.000000000  0.398009922 -0.77079417 -0.90333553 -0.77971034
##  [7,]  0.398009922  1.000000000 -0.85021191 -0.88310138 -0.84357704
##  [8,] -0.770794167 -0.850211909  1.00000000  0.40073111  0.24307710
##  [9,] -0.903335532 -0.883101378  0.40073111  1.00000000  0.37510953
## [10,] -0.779710340 -0.843577043  0.24307710  0.37510953  1.00000000
## [11,]  0.271451584  0.167154678 -0.66106568 -0.78882070 -0.62451749
## [12,]  0.042186651  0.009846428 -0.55702685 -0.69822147 -0.47586685
## [13,]  0.146588717  0.079995126 -0.64305206 -0.76457729 -0.56610790
## [14,]  0.081078097  0.078543860 -0.60573454 -0.72259724 -0.47708700
## [15,]  0.495713794  0.244092844 -0.73733403 -0.83506220 -0.71431024
## [16,] -0.194181458 -0.097304374 -0.61757522 -0.59821217 -0.44562284
## [17,] -0.732704318 -0.753859957  0.06808016  0.25184727  0.01309996
## [18,] -0.678065790 -0.679789019 -0.08323565  0.16015431 -0.17587623
## [19,] -0.790928555 -0.721141788  0.03856908  0.16956560  0.02273605
## [20,] -0.465089343 -0.568349260 -0.23964623 -0.13178377 -0.36656349
## [21,] -0.410684947 -0.410643998 -0.18430104 -0.26470552 -0.31349644
## [22,]  0.076260602 -0.172304747 -0.37051473 -0.58601058 -0.56270387
## [23,]  0.048901089 -0.075488279 -0.40179237 -0.57169347 -0.58774530
## [24,] -0.209643693 -0.337728949 -0.26131453 -0.36439691 -0.41462426
## [25,]  0.004354632 -0.224068288 -0.32295248 -0.52796492 -0.50121713
## [26,] -0.640943959 -0.571029931 -0.30872547 -0.08359196 -0.21632648
## [27,] -0.557939316 -0.528354342 -0.33959516 -0.22861080 -0.21569990
## [28,] -0.681995597 -0.592342065 -0.28059944 -0.07812640 -0.09582388
## [29,] -0.596568025 -0.552191193 -0.38232705 -0.19857632 -0.16355394
## [30,] -0.657646782 -0.579358795 -0.25503833 -0.03683252 -0.04667814
##              [,11]        [,12]       [,13]       [,14]      [,15]       [,16]
##  [1,]  0.170098622 -0.063807442  0.17145064 -0.02442125  0.4599531 -0.13741737
##  [2,]  0.456192527  0.297631805  0.35048083  0.33790975  0.5640887  0.11420036
##  [3,]  0.009147698 -0.201867074  0.07782707 -0.14212311  0.2868178 -0.17117085
##  [4,]  0.135622992 -0.009245082  0.23714943  0.05333665  0.4462545 -0.10155948
##  [5,]  0.483269726  0.214987727  0.30317954  0.26314287  0.5744981  0.04504740
##  [6,]  0.271451584  0.042186651  0.14658872  0.08107810  0.4957138 -0.19418146
##  [7,]  0.167154678  0.009846428  0.07999513  0.07854386  0.2440928 -0.09730437
##  [8,] -0.661065679 -0.557026853 -0.64305206 -0.60573454 -0.7373340 -0.61757522
##  [9,] -0.788820697 -0.698221468 -0.76457729 -0.72259724 -0.8350622 -0.59821217
## [10,] -0.624517492 -0.475866848 -0.56610790 -0.47708700 -0.7143102 -0.44562284
## [11,]  1.000000000  0.757779358  0.25144995  0.71422410  0.3791854  0.33948845
## [12,]  0.757779358  1.000000000  0.15887386  0.86244646  0.1553170  0.33689997
## [13,]  0.251449948  0.158873858  1.00000000  0.21014576  0.6463492  0.25504042
## [14,]  0.714224099  0.862446458  0.21014576  1.00000000  0.1645342  0.34277321
## [15,]  0.379185416  0.155316972  0.64634920  0.16453422  1.0000000  0.16949296
## [16,]  0.339488454  0.336899969  0.25504042  0.34277321  0.1694930  1.00000000
## [17,] -0.703042557 -0.625424904 -0.93824575 -0.68461659 -0.8747671 -0.68563892
## [18,] -0.923876520 -0.959082220 -0.70569356 -0.96680951 -0.7129023 -0.77509771
## [19,] -0.703484415 -0.595358702 -0.77392591 -0.67438940 -0.8347183 -0.59459560
## [20,] -0.706239645 -0.772662646 -0.60191672 -0.78698331 -0.5958444 -0.75536802
## [21,] -0.462010544 -0.431481866 -0.53630471 -0.49584375 -0.4778988 -0.56537775
## [22,]  0.195989025  0.085864462 -0.41716627 -0.02005197 -0.2426720 -0.43432192
## [23,] -0.138891719 -0.188976197 -0.30582730 -0.24893773 -0.1003122 -0.52494608
## [24,] -0.230426275 -0.263091947 -0.56786947 -0.34459385 -0.3978156 -0.51299231
## [25,] -0.174607063 -0.264021667 -0.46229664 -0.32870415 -0.2679411 -0.55334914
## [26,] -0.668367794 -0.616637666 -0.35979083 -0.55729167 -0.4630220 -0.29433943
## [27,] -0.585725545 -0.549227106 -0.24195178 -0.48522519 -0.4046148 -0.16226900
## [28,] -0.690333739 -0.627278909 -0.30438232 -0.57319518 -0.4734591 -0.23361900
## [29,] -0.619316863 -0.566939696 -0.16484923 -0.50367497 -0.3991750 -0.15020983
## [30,] -0.732513085 -0.677284477 -0.30928575 -0.62314094 -0.4671376 -0.34854129
##             [,17]         [,18]       [,19]      [,20]       [,21]        [,22]
##  [1,] -0.73524657 -0.6326636667 -0.77025374 -0.5035561 -0.40741213 -0.046230306
##  [2,] -0.79468498 -0.7795792918 -0.77977581 -0.6046433 -0.46101193 -0.036771191
##  [3,] -0.72989131 -0.5429701863 -0.73060826 -0.4538987 -0.39714564 -0.160697429
##  [4,] -0.74868637 -0.6689195140 -0.77906718 -0.5841102 -0.44098881 -0.238422853
##  [5,] -0.79708016 -0.7918652311 -0.78527872 -0.6248487 -0.48570080 -0.008859895
##  [6,] -0.73270432 -0.6780657900 -0.79092856 -0.4650893 -0.41068495  0.076260602
##  [7,] -0.75385996 -0.6797890190 -0.72114179 -0.5683493 -0.41064400 -0.172304747
##  [8,]  0.06808016 -0.0832356492  0.03856908 -0.2396462 -0.18430104 -0.370514725
##  [9,]  0.25184727  0.1601543107  0.16956560 -0.1317838 -0.26470552 -0.586010585
## [10,]  0.01309996 -0.1758762286  0.02273605 -0.3665635 -0.31349644 -0.562703871
## [11,] -0.70304256 -0.9238765204 -0.70348441 -0.7062396 -0.46201054  0.195989025
## [12,] -0.62542490 -0.9590822196 -0.59535870 -0.7726626 -0.43148187  0.085864462
## [13,] -0.93824575 -0.7056935609 -0.77392591 -0.6019167 -0.53630471 -0.417166267
## [14,] -0.68461659 -0.9668095101 -0.67438940 -0.7869833 -0.49584375 -0.020051967
## [15,] -0.87476707 -0.7129023253 -0.83471825 -0.5958444 -0.47789881 -0.242672011
## [16,] -0.68563892 -0.7750977122 -0.59459560 -0.7553680 -0.56537775 -0.434321921
## [17,]  1.00000000  0.0134567728  0.24182424 -0.1819428 -0.09817880 -0.258455271
## [18,]  0.01345677  1.0000000000  0.01443968  0.2405186 -0.16776688 -0.636425294
## [19,]  0.24182424  0.0144396769  1.00000000 -0.1781290 -0.09700553 -0.431927224
## [20,] -0.18194281  0.2405186269 -0.17812896  1.0000000 -0.25639450 -0.389588570
## [21,] -0.09817880 -0.1677668779 -0.09700553 -0.2563945  1.00000000 -0.154255989
## [22,] -0.25845527 -0.6364252940 -0.43192722 -0.3895886 -0.15425599  1.000000000
## [23,] -0.40750366 -0.4276844936 -0.42235751 -0.3373138  0.15472926  0.302550873
## [24,] -0.11287479 -0.3409276266 -0.26139836 -0.2981561  0.36915238  0.383179577
## [25,] -0.27645972 -0.3536333215 -0.38266720 -0.2645360  0.19164275  0.430880181
## [26,] -0.36416788 -0.1719600726 -0.36307965 -0.4210571 -0.65985219 -0.862372204
## [27,] -0.48721010 -0.2538896349 -0.42444637 -0.4315930 -0.75182978 -0.850836111
## [28,] -0.43005358 -0.1215806477 -0.26038249 -0.3774715 -0.63462160 -0.947072345
## [29,] -0.53029006 -0.2038244325 -0.34120753 -0.3605610 -0.63722464 -0.921308110
## [30,] -0.44041414  0.0008802478 -0.27416574 -0.3223613 -0.49445532 -0.940388037
##              [,23]      [,24]        [,25]       [,26]      [,27]       [,28]
##  [1,] -0.005020802 -0.2599961 -0.123550679 -0.59802621 -0.5301715 -0.66139592
##  [2,] -0.068605631 -0.3007802 -0.162857436 -0.57532584 -0.4936677 -0.60024747
##  [3,] -0.103970618 -0.2975950 -0.161619450 -0.53622317 -0.4664202 -0.57713849
##  [4,] -0.115781835 -0.4274745 -0.273442531 -0.46895599 -0.4118368 -0.52230350
##  [5,] -0.087405006 -0.2784217 -0.125090947 -0.61949072 -0.5184699 -0.63887391
##  [6,]  0.048901089 -0.2096437  0.004354632 -0.64094396 -0.5579393 -0.68199560
##  [7,] -0.075488279 -0.3377289 -0.224068288 -0.57102993 -0.5283543 -0.59234207
##  [8,] -0.401792367 -0.2613145 -0.322952484 -0.30872547 -0.3395952 -0.28059944
##  [9,] -0.571693471 -0.3643969 -0.527964920 -0.08359196 -0.2286108 -0.07812640
## [10,] -0.587745304 -0.4146243 -0.501217135 -0.21632648 -0.2156999 -0.09582388
## [11,] -0.138891719 -0.2304263 -0.174607063 -0.66836779 -0.5857255 -0.69033374
## [12,] -0.188976197 -0.2630919 -0.264021667 -0.61663767 -0.5492271 -0.62727891
## [13,] -0.305827297 -0.5678695 -0.462296641 -0.35979083 -0.2419518 -0.30438232
## [14,] -0.248937728 -0.3445938 -0.328704152 -0.55729167 -0.4852252 -0.57319518
## [15,] -0.100312180 -0.3978156 -0.267941062 -0.46302203 -0.4046148 -0.47345909
## [16,] -0.524946083 -0.5129923 -0.553349140 -0.29433943 -0.1622690 -0.23361900
## [17,] -0.407503657 -0.1128748 -0.276459724 -0.36416788 -0.4872101 -0.43005358
## [18,] -0.427684494 -0.3409276 -0.353633321 -0.17196007 -0.2538896 -0.12158065
## [19,] -0.422357506 -0.2613984 -0.382667199 -0.36307965 -0.4244464 -0.26038249
## [20,] -0.337313801 -0.2981561 -0.264535978 -0.42105708 -0.4315930 -0.37747153
## [21,]  0.154729255  0.3691524  0.191642747 -0.65985219 -0.7518298 -0.63462160
## [22,]  0.302550873  0.3831796  0.430880181 -0.86237220 -0.8508361 -0.94707234
## [23,]  1.000000000  0.3926387  0.476386668 -0.84917151 -0.9070083 -0.86229888
## [24,]  0.392638660  1.0000000  0.654156934 -0.82738107 -0.8654288 -0.85143779
## [25,]  0.476386668  0.6541569  1.000000000 -0.83287886 -0.8377860 -0.85483334
## [26,] -0.849171513 -0.8273811 -0.832878856  1.00000000  0.6724462  0.64000862
## [27,] -0.907008318 -0.8654288 -0.837786042  0.67244621  1.0000000  0.63797298
## [28,] -0.862298883 -0.8514378 -0.854833336  0.64000862  0.6379730  1.00000000
## [29,] -0.837469321 -0.8544313 -0.840794680  0.47554298  0.5614714  0.80570104
## [30,] -0.740827517 -0.7801628 -0.787033308  0.34440653  0.3362292  0.64538296
##            [,29]         [,30]
##  [1,] -0.5643941 -0.6236343554
##  [2,] -0.5165653 -0.6443699835
##  [3,] -0.4762368 -0.5655445919
##  [4,] -0.4427078 -0.5142018816
##  [5,] -0.5624511 -0.6620925354
##  [6,] -0.5965680 -0.6576467819
##  [7,] -0.5521912 -0.5793587950
##  [8,] -0.3823270 -0.2550383307
##  [9,] -0.1985763 -0.0368325204
## [10,] -0.1635539 -0.0466781388
## [11,] -0.6193169 -0.7325130848
## [12,] -0.5669397 -0.6772844769
## [13,] -0.1648492 -0.3092857487
## [14,] -0.5036750 -0.6231409414
## [15,] -0.3991750 -0.4671376204
## [16,] -0.1502098 -0.3485412888
## [17,] -0.5302901 -0.4404141429
## [18,] -0.2038244  0.0008802478
## [19,] -0.3412075 -0.2741657411
## [20,] -0.3605610 -0.3223613421
## [21,] -0.6372246 -0.4944553161
## [22,] -0.9213081 -0.9403880368
## [23,] -0.8374693 -0.7408275169
## [24,] -0.8544313 -0.7801627783
## [25,] -0.8407947 -0.7870333076
## [26,]  0.4755430  0.3444065257
## [27,]  0.5614714  0.3362292388
## [28,]  0.8057010  0.6453829551
## [29,]  1.0000000  0.5711647898
## [30,]  0.5711648  1.0000000000
## 
## $uppCI
##              [,1]        [,2]        [,3]        [,4]         [,5]         [,6]
##  [1,]  1.00000000  0.88647148  0.93655232  0.89922003  0.897559369  0.911704215
##  [2,]  0.88647148  1.00000000  0.86939092  0.88615176  0.923270199  0.918150328
##  [3,]  0.93655232  0.86939092  1.00000000  0.85218510  0.838134230  0.885028105
##  [4,]  0.89922003  0.88615176  0.85218510  1.00000000  0.852120868  0.858023901
##  [5,]  0.89755937  0.92327020  0.83813423  0.85212087  1.000000000  0.917329018
##  [6,]  0.91170421  0.91815033  0.88502810  0.85802390  0.917329018  1.000000000
##  [7,]  0.85383020  0.87222498  0.87802992  0.82938552  0.836796587  0.826082158
##  [8,] -0.38173749 -0.39660417 -0.32305619 -0.44230815 -0.354504993 -0.261661316
##  [9,] -0.65174889 -0.66880760 -0.58546412 -0.69833274 -0.688425359 -0.626520824
## [10,] -0.39643996 -0.27591311 -0.40788961 -0.34221224 -0.280847155 -0.282356432
## [11,]  0.72879793  0.84740729  0.64315645  0.71181544  0.856919149  0.775037160
## [12,]  0.59830070  0.78616461  0.50030456  0.63224368  0.749925776  0.662132921
## [13,]  0.72945021  0.80770185  0.68174935  0.75996912  0.788482598  0.717291155
## [14,]  0.62304356  0.80268710  0.54504064  0.66836256  0.771439168  0.683496511
## [15,]  0.84874353  0.88387304  0.78160640  0.84385203  0.887196818  0.861206866
## [16,]  0.54840553  0.70091211  0.52376778  0.57333689  0.663739472  0.506277600
## [17,] -0.18355816 -0.31818754 -0.17236613 -0.21229052 -0.324047799 -0.178227177
## [18,]  0.00854516 -0.28204887  0.14500324 -0.05434102 -0.311334805 -0.071014713
## [19,] -0.26042182 -0.28251012 -0.17385619 -0.28084795 -0.295520253 -0.309069445
## [20,]  0.19769399  0.05390398  0.25877099  0.08550233  0.021466852  0.245486916
## [21,]  0.31121135  0.25035819  0.32223135  0.27376821  0.220300738  0.307657227
## [22,]  0.60950111  0.61542217  0.53153914  0.47094911  0.632474856  0.680905036
## [23,]  0.63477274  0.59519760  0.57169877  0.56359566  0.582845815  0.665894651
## [24,]  0.45285519  0.41696549  0.41985142  0.28910387  0.436921949  0.494191998
## [25,]  0.55819359  0.52994588  0.53085964  0.44127234  0.557115649  0.640337234
## [26,]  0.06423312  0.09862126  0.15430857  0.24083405  0.030203080 -0.005383688
## [27,]  0.16255191  0.21030666  0.24388908  0.30640162  0.178221901  0.123914303
## [28,] -0.04087768  0.06078152  0.09593322  0.17312683 -0.001878245 -0.078284496
## [29,]  0.11462656  0.18073935  0.23198334  0.27179112  0.117434799  0.066490378
## [30,]  0.02345558 -0.01121988  0.11295849  0.18385067 -0.042114868 -0.034251741
##              [,7]         [,8]        [,9]       [,10]       [,11]       [,12]
##  [1,]  0.85383020 -0.381737486 -0.65174889 -0.39643996  0.72879793  0.59830070
##  [2,]  0.87222498 -0.396604170 -0.66880760 -0.27591311  0.84740729  0.78616461
##  [3,]  0.87802992 -0.323056191 -0.58546412 -0.40788961  0.64315645  0.50030456
##  [4,]  0.82938552 -0.442308146 -0.69833274 -0.34221224  0.71181544  0.63224368
##  [5,]  0.83679659 -0.354504993 -0.68842536 -0.28084716  0.85691915  0.74992578
##  [6,]  0.82608216 -0.261661316 -0.62652082 -0.28235643  0.77503716  0.66213292
##  [7,]  1.00000000 -0.464101761 -0.56168654 -0.44548985  0.72737411  0.64356600
##  [8,] -0.46410176  1.000000000  0.82710763  0.76261379 -0.04029184  0.12521768
##  [9,] -0.56168654  0.827107625  1.00000000  0.81733844 -0.30399149 -0.10899646
## [10,] -0.44548985  0.762613791  0.81733844  1.00000000  0.02200982  0.23243592
## [11,]  0.72737411 -0.040291838 -0.30399149  0.02200982  1.00000000  0.94084620
## [12,]  0.64356600  0.125217681 -0.10899646  0.23243592  0.94084620  1.00000000
## [13,]  0.68291527 -0.008969705 -0.24750327  0.11214039  0.76632002  0.72334313
## [14,]  0.68213516  0.052186953 -0.15735026  0.23094213  0.92887744  0.96785410
## [15,]  0.76306523 -0.187959851 -0.42209801 -0.14060166  0.81890972  0.72159979
## [16,]  0.57621470  0.033302397  0.06394476  0.26842462  0.80332050  0.80228142
## [17,] -0.22360377  0.676469572  0.76649505  0.64546826 -0.11834376  0.02052149
## [18,] -0.07419461  0.585612206  0.72396896  0.52023829 -0.69650483 -0.82743359
## [19,] -0.15438496  0.660093161  0.72854049  0.65105658 -0.11920566  0.06835727
## [20,]  0.10887613  0.469938761  0.55240491  0.35394198 -0.12460006 -0.26595977
## [21,]  0.30770182  0.513858896  0.44882567  0.40529811  0.24916847  0.28459444
## [22,]  0.52291943  0.349936060  0.08263330  0.11707009  0.74111495  0.68605629
## [23,]  0.59071159  0.317267617  0.10397840  0.08000469  0.54735367  0.51028516
## [24,]  0.38239652  0.451730040  0.35612738  0.30335256  0.47750773  0.45020957
## [25,]  0.48266671  0.396467486  0.16553383  0.20069842  0.52119264  0.44941260
## [26,]  0.10495280  0.409703197  0.58537640  0.48888302 -0.05334608  0.03481483
## [27,]  0.16500850  0.380595339  0.47898583  0.48938302  0.08306433  0.13626370
## [28,]  0.07299404  0.435008645  0.58898111  0.57721208 -0.09392490  0.01747165
## [29,]  0.13208594  0.337801039  0.50287024  0.52943108  0.03048490  0.11093069
## [30,]  0.09262721  0.457066005  0.61538402  0.60921896 -0.17782748 -0.06957700
##              [,13]       [,14]       [,15]       [,16]       [,17]        [,18]
##  [1,]  0.729450210  0.62304356  0.84874353  0.54840553 -0.18355816  0.008545160
##  [2,]  0.807701854  0.80268710  0.88387304  0.70091211 -0.31818754 -0.282048870
##  [3,]  0.681749348  0.54504064  0.78160640  0.52376778 -0.17236613  0.145003244
##  [4,]  0.759969124  0.66836256  0.84385203  0.57333689 -0.21229052 -0.054341023
##  [5,]  0.788482598  0.77143917  0.88719682  0.66373947 -0.32404780 -0.311334805
##  [6,]  0.717291155  0.68349651  0.86120687  0.50627760 -0.17822718 -0.071014713
##  [7,]  0.682915269  0.68213516  0.76306523  0.57621470 -0.22360377 -0.074194609
##  [8,] -0.008969705  0.05218695 -0.18795985  0.03330240  0.67646957  0.585612206
##  [9,] -0.247503275 -0.15735026 -0.42209801  0.06394476  0.76649505  0.723968957
## [10,]  0.112140391  0.23094213 -0.14060166  0.26842462  0.64546826  0.520238291
## [11,]  0.766320024  0.92887744  0.81890972  0.80332050 -0.11834376 -0.696504826
## [12,]  0.723343125  0.96785410  0.72159979  0.80228142  0.02052149 -0.827433591
## [13,]  1.000000000  0.74769815  0.90928717  0.76789891 -0.74817533 -0.123528157
## [14,]  0.747698145  1.00000000  0.72610268  0.80463502 -0.08316905 -0.858223405
## [15,]  0.909287174  0.72610268  1.00000000  0.72850540 -0.53608229 -0.137788434
## [16,]  0.767898912  0.80463502  0.72850540  1.00000000 -0.08508215 -0.271592061
## [17,] -0.748175325 -0.08316905 -0.53608229 -0.08508215  1.00000000  0.645676401
## [18,] -0.123528157 -0.85822340 -0.13778843 -0.27159206  0.64567640  1.000000000
## [19,] -0.268877377 -0.06427162 -0.42116453  0.06953292  0.76205626  0.646249282
## [20,]  0.058177258 -0.29958748  0.06760803 -0.22692861  0.51565240  0.761474437
## [21,]  0.154196837  0.20755102  0.22994640  0.11320062  0.57562467  0.526306307
## [22,]  0.300559162  0.62571080  0.46743184  0.28137928  0.45416730  0.002248161
## [23,]  0.412362851  0.46220401  0.57418219  0.16959290  0.31111223  0.288868321
## [24,]  0.109576113  0.37574375  0.32151815  0.18543762  0.56560225  0.379305945
## [25,]  0.248827227  0.39103032  0.44604031  0.13044722  0.43864017  0.366868861
## [26,]  0.360747426  0.12483966  0.24796122  0.42278619  0.35635794  0.523177450
## [27,]  0.468029609  0.22089271  0.31423329  0.53038041  0.21841869  0.458037098
## [28,]  0.413684346  0.10176838  0.23537389  0.47489855  0.28620530  0.559568942
## [29,]  0.528472349  0.19754092  0.32006836  0.53920596  0.16239138  0.498772605
## [30,]  0.409187618  0.02426216  0.24302623  0.37188436  0.27442780  0.638282879
##             [,19]       [,20]         [,21]        [,22]       [,23]      [,24]
##  [1,] -0.26042182  0.19769399  0.3112113545  0.609501109  0.63477274  0.4528552
##  [2,] -0.28251012  0.05390398  0.2503581948  0.615422171  0.59519760  0.4169655
##  [3,] -0.17385619  0.25877099  0.3222313516  0.531539136  0.57169877  0.4198514
##  [4,] -0.28084795  0.08550233  0.2737682062  0.470949111  0.56359566  0.2891039
##  [5,] -0.29552025  0.02146685  0.2203007376  0.632474856  0.58284582  0.4369219
##  [6,] -0.30906944  0.24548692  0.3076572272  0.680905036  0.66589465  0.4941920
##  [7,] -0.15438496  0.10887613  0.3077018207  0.522919427  0.59071159  0.3823965
##  [8,]  0.66009316  0.46993876  0.5138588960  0.349936060  0.31726762  0.4517300
##  [9,]  0.72854049  0.55240491  0.4488256685  0.082633299  0.10397840  0.3561274
## [10,]  0.65105658  0.35394198  0.4052981124  0.117070095  0.08000469  0.3033526
## [11,] -0.11920566 -0.12460006  0.2491684704  0.741114949  0.54735367  0.4775077
## [12,]  0.06835727 -0.26595977  0.2845944378  0.686056288  0.51028516  0.4502096
## [13,] -0.26887738  0.05817726  0.1541968367  0.300559162  0.41236285  0.1095761
## [14,] -0.06427162 -0.29958748  0.2075510211  0.625710805  0.46220401  0.3757437
## [15,] -0.42116453  0.06760803  0.2299464041  0.467431844  0.57418219  0.3215181
## [16,]  0.06953292 -0.22692861  0.1132006155  0.281379285  0.16959290  0.1854376
## [17,]  0.76205626  0.51565240  0.5756246661  0.454167297  0.31111223  0.5656023
## [18,]  0.64624928  0.76147444  0.5263063073  0.002248161  0.28886832  0.3793059
## [19,]  1.00000000  0.51854006  0.5764161819  0.284091322  0.29481601  0.4516584
## [20,]  0.51854006  1.00000000  0.4559173252  0.330220389  0.38279646  0.4193441
## [21,]  0.57641618  0.45591733  1.0000000000  0.536261544  0.72131104  0.8150300
## [22,]  0.28409132  0.33022039  0.5362615442  1.000000000  0.78822061  0.8204431
## [23,]  0.29481601  0.38279646  0.7213110371  0.788220614  1.00000000  0.8240497
## [24,]  0.45165842  0.41934407  0.8150300222  0.820443125  0.82404966  1.0000000
## [25,]  0.33744801  0.44897124  0.7390725802  0.838282356  0.85452511  0.9116016
## [26,]  0.35745224  0.29625957 -0.0381427906 -0.499122045 -0.46116056 -0.4014580
## [27,]  0.29249036  0.28446898 -0.2191472182 -0.465870474 -0.63871482 -0.5081153
## [28,]  0.45252569  0.34281835  0.0052738886 -0.781100735 -0.49890727 -0.4675783
## [29,]  0.37903473  0.35997736  0.0009034924 -0.687510945 -0.42865553 -0.4761179
## [30,]  0.44064253  0.39702346  0.2093105165 -0.756081492 -0.19537606 -0.2834191
##            [,25]        [,26]       [,27]        [,28]         [,29]
##  [1,]  0.5581936  0.064233117  0.16255191 -0.040877681  0.1146265574
##  [2,]  0.5299459  0.098621265  0.21030666  0.060781525  0.1807393461
##  [3,]  0.5308596  0.154308570  0.24388908  0.095933223  0.2319833387
##  [4,]  0.4412723  0.240834049  0.30640162  0.173126831  0.2717911221
##  [5,]  0.5571156  0.030203080  0.17822190 -0.001878245  0.1174347990
##  [6,]  0.6403372 -0.005383688  0.12391430 -0.078284496  0.0664903777
##  [7,]  0.4826667  0.104952796  0.16500850  0.072994043  0.1320859362
##  [8,]  0.3964675  0.409703197  0.38059534  0.435008645  0.3378010390
##  [9,]  0.1655338  0.585376398  0.47898583  0.588981112  0.5028702437
## [10,]  0.2006984  0.488883020  0.48938302  0.577212083  0.5294310810
## [11,]  0.5211926 -0.053346079  0.08306433 -0.093924904  0.0304849003
## [12,]  0.4494126  0.034814826  0.13626370  0.017471649  0.1109306916
## [13,]  0.2488272  0.360747426  0.46802961  0.413684346  0.5284723492
## [14,]  0.3910303  0.124839660  0.22089271  0.101768380  0.1975409164
## [15,]  0.4460403  0.247961219  0.31423329  0.235373889  0.3200683601
## [16,]  0.1304472  0.422786189  0.53038041  0.474898549  0.5392059578
## [17,]  0.4386402  0.356357938  0.21841869  0.286205303  0.1623913824
## [18,]  0.3668689  0.523177450  0.45803710  0.559568942  0.4987726046
## [19,]  0.3374480  0.357452238  0.29249036  0.452525694  0.3790347316
## [20,]  0.4489712  0.296259570  0.28446898  0.342818349  0.3599773624
## [21,]  0.7390726 -0.038142791 -0.21914722  0.005273889  0.0009034924
## [22,]  0.8382824 -0.499122045 -0.46587047 -0.781100735 -0.6875109455
## [23,]  0.8545251 -0.461160560 -0.63871482 -0.498907272 -0.4286555251
## [24,]  0.9116016 -0.401457991 -0.50811530 -0.467578278 -0.4761178713
## [25,]  1.0000000 -0.416187254 -0.42952156 -0.477270258 -0.4377859330
## [26,] -0.4161873  1.000000000  0.91695983  0.907395627  0.8542305509
## [27,] -0.4295216  0.916959830  1.00000000  0.906786040  0.8830321749
## [28,] -0.4772703  0.907395627  0.90678604  1.000000000  0.9535073380
## [29,] -0.4377859  0.854230551  0.88303217  0.953507338  1.0000000000
## [30,] -0.2997070  0.805286974  0.80201171  0.908999621  0.8861359967
##             [,30]
##  [1,]  0.02345558
##  [2,] -0.01121988
##  [3,]  0.11295849
##  [4,]  0.18385067
##  [5,] -0.04211487
##  [6,] -0.03425174
##  [7,]  0.09262721
##  [8,]  0.45706601
##  [9,]  0.61538402
## [10,]  0.60921896
## [11,] -0.17782748
## [12,] -0.06957700
## [13,]  0.40918762
## [14,]  0.02426216
## [15,]  0.24302623
## [16,]  0.37188436
## [17,]  0.27442780
## [18,]  0.63828288
## [19,]  0.44064253
## [20,]  0.39702346
## [21,]  0.20931052
## [22,] -0.75608149
## [23,] -0.19537606
## [24,] -0.28341906
## [25,] -0.29970704
## [26,]  0.80528697
## [27,]  0.80201171
## [28,]  0.90899962
## [29,]  0.88613600
## [30,]  1.00000000
corrplot::corrplot(perstdMatrix_AEO, p.mat = res_max_AEO$p, type="lower", sig.level = .05)

#Showing p-value for non-significant results
corrplot(perstdMatrix_AEO, p.mat = res_max_AEO$p, type="lower",insig = "p-value")

Step 2: Check if data is suitable - look at the relevant Statistics

checking for multicollinearity, inspect determinant > 0.00001 1. Barteltt’s test: 2. KMO Measure of Sampling Adequacy 3. Determinant test

# Bartlett’s test: test variables are correlated
#Compares the correlation matrix with a matrix of zero correlations (technically called the identity matrix, #which consists of all zeros except the 1’s along the diagonal). 


cat("\n *** Barteltt's test result for Stduent Personality data (A,E,O) *** \n")
## 
##  *** Barteltt's test result for Stduent Personality data (A,E,O) ***
psych::cortest.bartlett(std_AEO)
## R was not square, finding R from data
## $chisq
## [1] 3978.985
## 
## $p.value
## [1] 0
## 
## $df
## [1] 435
cat("\n *** Barteltt's test result for Stduent Personality Correlation Matrix (A,E,O) *** \n")
## 
##  *** Barteltt's test result for Stduent Personality Correlation Matrix (A,E,O) ***
psych::cortest.bartlett(perstdMatrix_AEO, n=nrow(std_AEO))
## $chisq
## [1] 3978.985
## 
## $p.value
## [1] 0
## 
## $df
## [1] 435
# KMO test:the proportion of variance in your variables that might be caused by an underlying factor. 
# High values close to 1 ->  PCA/FA might be useful
# Values over 0.8 or over are considered strong
# Anything less than 0.5 suggests that PCA/FA won’t be useful
# KMO reference:
# 0.00 to 0.49 unacceptable.
# 0.50 to 0.59 miserable.
# 0.60 to 0.69 mediocre.
# 0.70 to 0.79 middling.
# 0.80 to 0.89 meritorious.
# 0.90 to 1.00 marvellous.

cat("\n *** KMO test result for Stduent Personality data (A,E,O) *** \n")
## 
##  *** KMO test result for Stduent Personality data (A,E,O) ***
REdaS::KMOS(std_AEO)
## 
## Kaiser-Meyer-Olkin Statistics
## 
## Call: REdaS::KMOS(x = std_AEO)
## 
## Measures of Sampling Adequacy (MSA):
##        A1        A2        A3        A4        A5        A6        A7        A8 
## 0.8754913 0.9100732 0.8287707 0.8450145 0.8760763 0.8744542 0.8133833 0.6757972 
##        A9       A10        E1        E2        E3        E4        E5        E6 
## 0.8404421 0.7426791 0.8815091 0.8186950 0.7713451 0.8324620 0.8370609 0.8218991 
##        E7        E8        E9       E10        O1        O2        O3        O4 
## 0.6594875 0.7629369 0.6834679 0.7154004 0.7322455 0.8119045 0.7779430 0.7920795 
##        O5        O6        O7        O8        O9       O10 
## 0.8216486 0.7868623 0.7807232 0.7991763 0.7916679 0.8379533 
## 
## KMO-Criterion: 0.816615
cat("\n *** KMO test result for Stduent Personality Correlation Matrix (A,E,O) *** \n")
## 
##  *** KMO test result for Stduent Personality Correlation Matrix (A,E,O) ***
psych::KMO(std_AEO)
## Kaiser-Meyer-Olkin factor adequacy
## Call: psych::KMO(r = std_AEO)
## Overall MSA =  0.82
## MSA for each item = 
##   A1   A2   A3   A4   A5   A6   A7   A8   A9  A10   E1   E2   E3   E4   E5   E6 
## 0.88 0.91 0.83 0.85 0.88 0.87 0.81 0.68 0.84 0.74 0.88 0.82 0.77 0.83 0.84 0.82 
##   E7   E8   E9  E10   O1   O2   O3   O4   O5   O6   O7   O8   O9  O10 
## 0.66 0.76 0.68 0.72 0.73 0.81 0.78 0.79 0.82 0.79 0.78 0.80 0.79 0.84
#the result is 0.82, PCA/FA is userful
# Determinant test
#Indicator of multicollinearity
#Should be greater than 0.00001 = 1.0e-5

cat("\n *** Determinant test result for Stduent Personality data (A,E,O) *** \n")
## 
##  *** Determinant test result for Stduent Personality data (A,E,O) ***
det(cor(std_AEO))
## [1] 2.146319e-05
cat("\n *** Determinant test result for Stduent Personality Correlation Matrix (A,E,O) *** \n")
## 
##  *** Determinant test result for Stduent Personality Correlation Matrix (A,E,O) ***
det(perstdMatrix_AEO)
## [1] 2.146319e-05
#the result is greater than 0.00001

Step 3: Dimension Reduction by PCA (Principal Components Analysis)

## Principal Components Analysis
## Call: principal(r = std_AEO, nfactors = length(std_AEO), rotate = "none")
## Standardized loadings (pattern matrix) based upon correlation matrix
##       PC1   PC2   PC3   PC4   PC5   PC6   PC7   PC8   PC9  PC10  PC11  PC12
## A1   0.62  0.05  0.08 -0.36  0.14  0.07 -0.08  0.00 -0.08 -0.06 -0.10  0.33
## A2   0.72  0.15  0.13 -0.07  0.14  0.02  0.09  0.05  0.03  0.07  0.07 -0.03
## A3   0.54  0.11  0.14 -0.42  0.22  0.00  0.06 -0.09  0.09 -0.24  0.20  0.29
## A4   0.54  0.16 -0.04 -0.29  0.12 -0.13 -0.29  0.28  0.00  0.16 -0.34  0.00
## A5   0.66  0.05 -0.11 -0.11  0.01  0.12  0.00 -0.03 -0.33 -0.16  0.00 -0.21
## A6   0.65  0.02  0.18 -0.25  0.09  0.27 -0.02  0.23 -0.10  0.05  0.18 -0.02
## A7   0.49  0.05 -0.13 -0.26  0.16 -0.35  0.09 -0.14  0.34 -0.02  0.40  0.09
## A8  -0.22 -0.08  0.44  0.29 -0.19  0.31 -0.22  0.11  0.34 -0.40  0.03  0.04
## A9  -0.47  0.00  0.43  0.29 -0.07  0.11 -0.02 -0.27  0.13  0.28  0.11  0.22
## A10 -0.19  0.10  0.41  0.39 -0.10  0.07 -0.08  0.26 -0.43 -0.04  0.22  0.32
## E1   0.64 -0.01 -0.03  0.45  0.02  0.10  0.18 -0.12 -0.01  0.10 -0.09 -0.01
## E2   0.55  0.01  0.00  0.65  0.08 -0.09  0.06  0.12  0.11  0.06 -0.03 -0.01
## E3   0.51  0.38  0.14  0.08 -0.51  0.06  0.09 -0.01  0.09 -0.10 -0.16  0.08
## E4   0.54  0.09 -0.08  0.60  0.06 -0.10 -0.03  0.17  0.08  0.09  0.21  0.00
## E5   0.63  0.26  0.18 -0.06 -0.33  0.13 -0.10 -0.14 -0.02  0.17 -0.23 -0.01
## E6   0.38  0.33  0.15  0.37  0.08 -0.13  0.18 -0.48 -0.15  0.01 -0.16  0.17
## E7  -0.27 -0.25  0.35  0.11  0.63  0.01 -0.14  0.09 -0.10  0.25 -0.12  0.13
## E8  -0.36  0.01  0.46 -0.54 -0.08  0.05  0.06 -0.20 -0.09 -0.01 -0.11  0.15
## E9  -0.20 -0.08  0.39  0.13  0.28 -0.29  0.42  0.17  0.06 -0.37 -0.34  0.01
## E10 -0.10 -0.07  0.30 -0.31 -0.08  0.32  0.60  0.21  0.14  0.37  0.07 -0.09
## O1   0.13 -0.20  0.57 -0.02 -0.03 -0.42 -0.09  0.01  0.03  0.05 -0.02 -0.20
## O2   0.36 -0.58  0.14  0.17  0.18  0.39  0.08  0.02  0.13 -0.06 -0.09  0.06
## O3   0.34 -0.40  0.38 -0.12 -0.28 -0.22 -0.15  0.15  0.25  0.10 -0.13  0.10
## O4   0.23 -0.47  0.51  0.03  0.03 -0.10 -0.07 -0.29 -0.16  0.02  0.12 -0.23
## O5   0.31 -0.40  0.50 -0.08 -0.03  0.08 -0.08 -0.05 -0.11 -0.12  0.15 -0.34
## O6  -0.12  0.59  0.18  0.00  0.28  0.17 -0.29 -0.13  0.28  0.14 -0.09 -0.15
## O7  -0.06  0.67  0.14  0.02  0.27  0.33 -0.08 -0.07  0.06 -0.15  0.02 -0.10
## O8  -0.17  0.75  0.26  0.02  0.09 -0.08  0.04  0.05  0.02 -0.03  0.03 -0.21
## O9  -0.08  0.71  0.22  0.00  0.01 -0.07  0.21  0.12 -0.09 -0.03  0.02 -0.11
## O10 -0.14  0.57  0.34 -0.07 -0.16 -0.26 -0.08  0.17 -0.06  0.09  0.17  0.10
##      PC13  PC14  PC15  PC16  PC17  PC18  PC19  PC20  PC21  PC22  PC23  PC24
## A1  -0.14 -0.17  0.11 -0.16  0.26  0.06  0.08  0.05  0.07 -0.10  0.12 -0.18
## A2   0.12  0.22 -0.08 -0.08 -0.31  0.11 -0.27  0.01  0.18  0.13 -0.03 -0.21
## A3  -0.20 -0.08 -0.07 -0.17 -0.04 -0.04  0.05 -0.15 -0.01  0.08 -0.19  0.02
## A4  -0.19  0.21 -0.12  0.14  0.12  0.05 -0.08  0.10  0.13 -0.02 -0.24  0.12
## A5   0.26 -0.23  0.22 -0.04 -0.03  0.17  0.04  0.28  0.07  0.16  0.00  0.05
## A6   0.17 -0.14  0.01  0.01 -0.13 -0.14 -0.21 -0.10 -0.28 -0.12  0.00  0.10
## A7   0.15  0.12  0.11  0.23 -0.03  0.01  0.19  0.11  0.07 -0.13  0.06  0.07
## A8  -0.12 -0.25 -0.10  0.15 -0.13  0.18 -0.01  0.01  0.09  0.03 -0.05 -0.01
## A9   0.17 -0.05  0.08 -0.19  0.09 -0.07 -0.16  0.25  0.10 -0.10 -0.24 -0.07
## A10  0.01  0.31  0.17 -0.01 -0.07  0.09  0.19 -0.06  0.00 -0.03 -0.08  0.08
## E1  -0.02 -0.14  0.04  0.22  0.02 -0.21  0.15  0.00  0.05  0.05 -0.19  0.10
## E2  -0.02  0.02 -0.01  0.02  0.01 -0.01 -0.08 -0.09  0.00 -0.14  0.13 -0.22
## E3  -0.12  0.19  0.11 -0.03 -0.04 -0.07  0.06  0.11  0.06  0.07  0.22 -0.01
## E4  -0.06  0.08 -0.05 -0.09  0.11  0.01 -0.05  0.03 -0.05  0.12  0.04  0.07
## E5   0.16 -0.12  0.09  0.06 -0.07 -0.02  0.10 -0.23  0.03 -0.22 -0.04 -0.06
## E6  -0.08 -0.03 -0.22  0.12 -0.03  0.21 -0.03  0.01 -0.22  0.10 -0.01  0.06
## E7   0.03 -0.18 -0.08  0.12 -0.16  0.04  0.16  0.07  0.05  0.00  0.19 -0.05
## E8   0.07  0.21 -0.06  0.19 -0.14 -0.16 -0.07  0.03  0.00  0.07  0.10  0.00
## E9   0.26  0.06  0.18 -0.04  0.13  0.00 -0.07 -0.08 -0.02 -0.03 -0.09  0.00
## E10 -0.18 -0.03  0.06  0.05  0.09  0.25  0.07 -0.02 -0.01  0.05 -0.01  0.01
## O1  -0.38 -0.11  0.34  0.01 -0.22 -0.08 -0.05  0.12 -0.14 -0.02 -0.04 -0.01
## O2   0.01  0.07  0.00  0.01  0.03 -0.29 -0.01  0.05  0.12  0.09  0.10  0.16
## O3   0.31 -0.01 -0.21 -0.15  0.03  0.15  0.08  0.10 -0.16  0.00  0.06  0.15
## O4  -0.11  0.03 -0.02 -0.15  0.16  0.10 -0.14 -0.20  0.22 -0.06  0.14  0.21
## O5   0.05  0.18 -0.22  0.11  0.21 -0.08  0.20  0.05 -0.10  0.02 -0.11 -0.28
## O6   0.09  0.13  0.23 -0.20  0.04 -0.02  0.16 -0.15 -0.13  0.25  0.01  0.00
## O7  -0.06  0.16  0.07  0.17  0.17  0.11 -0.16  0.15 -0.12 -0.22  0.08  0.08
## O8   0.12 -0.06 -0.13 -0.02 -0.12  0.02  0.15 -0.08  0.25 -0.09 -0.04  0.08
## O9  -0.12 -0.10 -0.29 -0.28 -0.03 -0.22  0.09  0.18 -0.02 -0.08  0.06  0.04
## O10  0.10 -0.24  0.01  0.27  0.28 -0.11 -0.17 -0.08  0.06  0.23  0.08 -0.03
##      PC25  PC26  PC27  PC28  PC29  PC30 h2       u2  com
## A1   0.08  0.22 -0.14 -0.08 -0.03  0.00  1 -4.4e-16  5.2
## A2   0.01 -0.04 -0.18 -0.11  0.04 -0.09  1 -2.9e-15  3.5
## A3   0.04 -0.23  0.10  0.16 -0.05  0.01  1 -2.2e-15  7.1
## A4  -0.09  0.04  0.13 -0.03  0.02  0.05  1 -1.6e-15  7.8
## A5   0.00 -0.05  0.10  0.06  0.02  0.13  1 -1.8e-15  4.6
## A6  -0.05  0.17  0.14 -0.07 -0.08 -0.07  1 -4.4e-16  5.0
## A7  -0.10  0.05  0.05 -0.09  0.08  0.02  1  3.3e-16  8.0
## A8   0.00  0.09  0.05 -0.10  0.09  0.03  1  2.2e-15  9.7
## A9  -0.04  0.02  0.10  0.04 -0.03 -0.02  1  1.1e-16  8.9
## A10 -0.05 -0.03 -0.06 -0.07  0.00  0.05  1  4.4e-16  8.6
## E1   0.27 -0.05 -0.06 -0.20 -0.06 -0.06  1 -2.2e-16  4.5
## E2   0.02 -0.10  0.15 -0.02 -0.13  0.27  1 -6.7e-16  3.6
## E3  -0.04 -0.03  0.20  0.03 -0.10 -0.21  1  1.2e-15  6.0
## E4   0.20  0.18  0.02  0.25  0.20 -0.03  1 -4.4e-16  4.4
## E5  -0.06 -0.08 -0.06  0.13  0.23  0.00  1  0.0e+00  5.3
## E6  -0.18  0.11 -0.03  0.00 -0.03  0.02  1  0.0e+00  8.6
## E7   0.01 -0.09  0.12  0.06  0.04 -0.14  1  1.4e-15  5.3
## E8   0.25  0.11  0.08  0.05  0.06  0.19  1 -8.9e-16  6.4
## E9   0.00  0.03  0.05  0.00  0.07 -0.06  1 -2.2e-16  9.2
## E10 -0.01  0.00  0.02  0.02  0.01  0.04  1 -6.7e-16  5.5
## O1  -0.01  0.01 -0.13  0.06 -0.03  0.02  1  1.3e-15  5.6
## O2  -0.24  0.01 -0.18  0.10 -0.02  0.09  1  1.1e-15  6.0
## O3   0.11 -0.12 -0.13 -0.01 -0.10  0.02  1  3.3e-16 11.7
## O4   0.03 -0.03  0.09 -0.11  0.03 -0.03  1  1.1e-15  7.2
## O5  -0.05  0.02  0.02  0.04 -0.01 -0.06  1  3.3e-16  7.8
## O6  -0.02  0.03  0.04 -0.12  0.01  0.06  1  1.1e-16  6.5
## O7   0.11 -0.18 -0.12  0.05 -0.02 -0.04  1  1.1e-16  4.5
## O8   0.02  0.18 -0.08  0.17 -0.23  0.01  1  1.1e-16  3.0
## O9  -0.05 -0.06  0.00 -0.15  0.17  0.06  1  1.4e-15  3.6
## O10 -0.09 -0.10 -0.06 -0.01 -0.01  0.00  1  1.1e-16  6.9
## 
##                        PC1  PC2  PC3  PC4  PC5  PC6  PC7  PC8  PC9 PC10 PC11
## SS loadings           5.44 3.58 2.59 2.45 1.36 1.21 0.99 0.92 0.87 0.83 0.82
## Proportion Var        0.18 0.12 0.09 0.08 0.05 0.04 0.03 0.03 0.03 0.03 0.03
## Cumulative Var        0.18 0.30 0.39 0.47 0.51 0.55 0.59 0.62 0.65 0.68 0.70
## Proportion Explained  0.18 0.12 0.09 0.08 0.05 0.04 0.03 0.03 0.03 0.03 0.03
## Cumulative Proportion 0.18 0.30 0.39 0.47 0.51 0.55 0.59 0.62 0.65 0.68 0.70
##                       PC12 PC13 PC14 PC15 PC16 PC17 PC18 PC19 PC20 PC21 PC22
## SS loadings           0.80 0.73 0.70 0.64 0.60 0.56 0.51 0.50 0.45 0.43 0.41
## Proportion Var        0.03 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.01 0.01
## Cumulative Var        0.73 0.75 0.78 0.80 0.82 0.84 0.85 0.87 0.89 0.90 0.91
## Proportion Explained  0.03 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.01 0.01
## Cumulative Proportion 0.73 0.75 0.78 0.80 0.82 0.84 0.85 0.87 0.89 0.90 0.91
##                       PC23 PC24 PC25 PC26 PC27 PC28 PC29 PC30
## SS loadings           0.40 0.38 0.34 0.33 0.33 0.30 0.26 0.25
## Proportion Var        0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01
## Cumulative Var        0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00
## Proportion Explained  0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01
## Cumulative Proportion 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00
## 
## Mean item complexity =  6.3
## Test of the hypothesis that 30 components are sufficient.
## 
## The root mean square of the residuals (RMSR) is  0 
##  with the empirical chi square  0  with prob <  NA 
## 
## Fit based upon off diagonal values = 1

#Factor Analysis
#Principal Axis Factoring fm=pa
factsol <- fa(perstdMatrix_AEO, nfactors=3, obs=NA, n.iter=1, rotate="varimax", fm="pa")
psych::print.psych(factsol,cut=0.3, sort=TRUE)
## Factor Analysis using method =  pa
## Call: fa(r = perstdMatrix_AEO, nfactors = 3, n.iter = 1, rotate = "varimax", 
##     fm = "pa", obs = NA)
## Standardized loadings (pattern matrix) based upon correlation matrix
##     item   PA1   PA2   PA3    h2   u2 com
## A2     2  0.72             0.522 0.48 1.0
## E5    15  0.66             0.450 0.55 1.1
## A6     6  0.64             0.428 0.57 1.1
## A1     1  0.60             0.369 0.63 1.0
## A5     5  0.59             0.394 0.61 1.3
## A3     3  0.55             0.313 0.69 1.1
## E1    11  0.55             0.396 0.60 1.6
## E3    13  0.55             0.360 0.64 1.4
## A4     4  0.51             0.270 0.73 1.1
## E2    12  0.46             0.296 0.70 1.8
## E4    14  0.45       -0.33 0.322 0.68 1.9
## A7     7  0.43             0.202 0.80 1.2
## E6    16  0.39             0.202 0.80 1.7
## A9     9 -0.35        0.33 0.251 0.75 2.4
## O8    28        0.78       0.616 0.38 1.0
## O9    29        0.69       0.482 0.52 1.0
## O7    27        0.60       0.374 0.63 1.0
## O10   30        0.58       0.367 0.63 1.2
## O2    22       -0.56       0.398 0.60 1.5
## O6    26        0.55       0.303 0.70 1.0
## E8    18              0.58 0.425 0.58 1.5
## O5    25  0.31 -0.33  0.48 0.438 0.56 2.6
## O4    24       -0.37  0.48 0.416 0.58 2.3
## O1    21              0.45 0.248 0.75 1.4
## O3    23  0.31 -0.34  0.36 0.342 0.66 3.0
## E7    17              0.32 0.156 0.84 2.0
## E10   20              0.30 0.094 0.91 1.0
## A8     8                   0.107 0.89 1.5
## E9    19                   0.100 0.90 1.4
## A10   10                   0.074 0.93 2.3
## 
##                        PA1  PA2  PA3
## SS loadings           4.61 3.06 2.04
## Proportion Var        0.15 0.10 0.07
## Cumulative Var        0.15 0.26 0.32
## Proportion Explained  0.47 0.32 0.21
## Cumulative Proportion 0.47 0.79 1.00
## 
## Mean item complexity =  1.5
## Test of the hypothesis that 3 factors are sufficient.
## 
## The degrees of freedom for the null model are  435  and the objective function was  10.75
## The degrees of freedom for the model are 348  and the objective function was  3.83 
## 
## The root mean square of the residuals (RMSR) is  0.08 
## The df corrected root mean square of the residuals is  0.09 
## 
## Fit based upon off diagonal values = 0.86
## Measures of factor score adequacy             
##                                                    PA1  PA2  PA3
## Correlation of (regression) scores with factors   0.94 0.92 0.87
## Multiple R square of scores with factors          0.88 0.85 0.75
## Minimum correlation of possible factor scores     0.76 0.69 0.50
fa.graph(factsol)
## digraph Factor  {
##   rankdir=RL;
##   size="8,6";
##   node [fontname="Helvetica" fontsize=14 shape=box, width=2];
##   edge [fontname="Helvetica" fontsize=10];
## V1  [label = "A1"];
## V2  [label = "A2"];
## V3  [label = "A3"];
## V4  [label = "A4"];
## V5  [label = "A5"];
## V6  [label = "A6"];
## V7  [label = "A7"];
## V8  [label = "A8"];
## V9  [label = "A9"];
## V10  [label = "A10"];
## V11  [label = "E1"];
## V12  [label = "E2"];
## V13  [label = "E3"];
## V14  [label = "E4"];
## V15  [label = "E5"];
## V16  [label = "E6"];
## V17  [label = "E7"];
## V18  [label = "E8"];
## V19  [label = "E9"];
## V20  [label = "E10"];
## V21  [label = "O1"];
## V22  [label = "O2"];
## V23  [label = "O3"];
## V24  [label = "O4"];
## V25  [label = "O5"];
## V26  [label = "O6"];
## V27  [label = "O7"];
## V28  [label = "O8"];
## V29  [label = "O9"];
## V30  [label = "O10"];
## node [shape=ellipse, width ="1"];
## PA1-> V1 [ label = 0.6 ];
## PA1-> V2 [ label = 0.7 ];
## PA1-> V3 [ label = 0.5 ];
## PA1-> V4 [ label = 0.5 ];
## PA1-> V5 [ label = 0.6 ];
## PA1-> V6 [ label = 0.6 ];
## PA1-> V7 [ label = 0.4 ];
## PA1-> V9 [ label = -0.3 ];
## PA1-> V11 [ label = 0.5 ];
## PA1-> V12 [ label = 0.5 ];
## PA1-> V13 [ label = 0.5 ];
## PA1-> V14 [ label = 0.5 ];
## PA1-> V15 [ label = 0.7 ];
## PA1-> V16 [ label = 0.4 ];
## PA2-> V22 [ label = -0.6 ];
## PA2-> V26 [ label = 0.5 ];
## PA2-> V27 [ label = 0.6 ];
## PA2-> V28 [ label = 0.8 ];
## PA2-> V29 [ label = 0.7 ];
## PA2-> V30 [ label = 0.6 ];
## PA3-> V17 [ label = 0.3 ];
## PA3-> V18 [ label = 0.6 ];
## PA3-> V20 [ label = 0.3 ];
## PA3-> V21 [ label = 0.5 ];
## PA3-> V23 [ label = 0.4 ];
## PA3-> V24 [ label = 0.5 ];
## PA3-> V25 [ label = 0.5 ];
## { rank=same;
## V1;V2;V3;V4;V5;V6;V7;V8;V9;V10;V11;V12;V13;V14;V15;V16;V17;V18;V19;V20;V21;V22;V23;V24;V25;V26;V27;V28;V29;V30;}{ rank=same;
## PA1;PA2;PA3;}}
fa.sort(factsol$loading)
## 
## Loadings:
##     PA1    PA2    PA3   
## A2   0.722              
## E5   0.659  0.125       
## A6   0.643              
## A1   0.604              
## A5   0.590 -0.111 -0.186
## A3   0.549         0.102
## E1   0.549 -0.181 -0.249
## E3   0.547  0.234       
## A4   0.512              
## E2   0.457 -0.139 -0.260
## E4   0.454        -0.328
## A7   0.427        -0.120
## E6   0.389  0.196 -0.108
## A9  -0.350  0.151  0.326
## O8          0.781       
## O9          0.687       
## O7          0.605       
## O10         0.577  0.179
## O2   0.246 -0.564  0.138
## O6          0.549       
## E8  -0.211  0.196  0.585
## O5   0.315 -0.328  0.481
## O4   0.218 -0.371  0.480
## O1   0.179         0.455
## O3   0.312 -0.340  0.359
## E7  -0.218         0.316
## E10                0.304
## A8  -0.146         0.290
## E9  -0.130         0.286
## A10         0.154  0.204
## 
##                  PA1   PA2   PA3
## SS loadings    4.611 3.065 2.038
## Proportion Var 0.154 0.102 0.068
## Cumulative Var 0.154 0.256 0.324
fa.diagram(factsol)#create a diagram showing the factors and how the manifest variables load

plot(factsol$values, type = "b") #scree plot

#Cattell (1966) suggests using the ‘point of inflexion’ of the scree plot to decide how many factors to extract

Step 4: Decide which components to retain by PCA

cat("\n ****** the variance explained by each component ****** \n")
## 
##  ****** the variance explained by each component ******
pca$Vaccounted
##                             PC1       PC2        PC3        PC4        PC5
## SS loadings           5.4418988 3.5848171 2.59159171 2.45164176 1.35903681
## Proportion Var        0.1813966 0.1194939 0.08638639 0.08172139 0.04530123
## Cumulative Var        0.1813966 0.3008905 0.38727692 0.46899831 0.51429954
## Proportion Explained  0.1813966 0.1194939 0.08638639 0.08172139 0.04530123
## Cumulative Proportion 0.1813966 0.3008905 0.38727692 0.46899831 0.51429954
##                              PC6        PC7        PC8       PC9       PC10
## SS loadings           1.21130561 0.99123094 0.92278265 0.8672491 0.83366725
## Proportion Var        0.04037685 0.03304103 0.03075942 0.0289083 0.02778891
## Cumulative Var        0.55467640 0.58771743 0.61847685 0.6473852 0.67517406
## Proportion Explained  0.04037685 0.03304103 0.03075942 0.0289083 0.02778891
## Cumulative Proportion 0.55467640 0.58771743 0.61847685 0.6473852 0.67517406
##                             PC11       PC12       PC13       PC14       PC15
## SS loadings           0.82287232 0.80443707 0.73430158 0.69520832 0.63503972
## Proportion Var        0.02742908 0.02681457 0.02447672 0.02317361 0.02116799
## Cumulative Var        0.70260314 0.72941771 0.75389443 0.77706804 0.79823603
## Proportion Explained  0.02742908 0.02681457 0.02447672 0.02317361 0.02116799
## Cumulative Proportion 0.70260314 0.72941771 0.75389443 0.77706804 0.79823603
##                             PC16       PC17       PC18      PC19       PC20
## SS loadings           0.60482207 0.56338838 0.50817416 0.4969471 0.45273052
## Proportion Var        0.02016074 0.01877961 0.01693914 0.0165649 0.01509102
## Cumulative Var        0.81839676 0.83717638 0.85411552 0.8706804 0.88577143
## Proportion Explained  0.02016074 0.01877961 0.01693914 0.0165649 0.01509102
## Cumulative Proportion 0.81839676 0.83717638 0.85411552 0.8706804 0.88577143
##                             PC21       PC22       PC23       PC24       PC25
## SS loadings           0.43323733 0.40770152 0.40206968 0.38016343 0.34276023
## Proportion Var        0.01444124 0.01359005 0.01340232 0.01267211 0.01142534
## Cumulative Var        0.90021268 0.91380273 0.92720505 0.93987717 0.95130251
## Proportion Explained  0.01444124 0.01359005 0.01340232 0.01267211 0.01142534
## Cumulative Proportion 0.90021268 0.91380273 0.92720505 0.93987717 0.95130251
##                             PC26       PC27       PC28        PC29        PC30
## SS loadings           0.33023591 0.32555046 0.30056280 0.257070196 0.247505423
## Proportion Var        0.01100786 0.01085168 0.01001876 0.008569007 0.008250181
## Cumulative Var        0.96231037 0.97316205 0.98318081 0.991749819 1.000000000
## Proportion Explained  0.01100786 0.01085168 0.01001876 0.008569007 0.008250181
## Cumulative Proportion 0.96231037 0.97316205 0.98318081 0.991749819 1.000000000
cat("\n *********** the Eigenvalues ************ \n")
## 
##  *********** the Eigenvalues ************
pca$values
##  [1] 5.4418988 3.5848171 2.5915917 2.4516418 1.3590368 1.2113056 0.9912309
##  [8] 0.9227826 0.8672491 0.8336672 0.8228723 0.8044371 0.7343016 0.6952083
## [15] 0.6350397 0.6048221 0.5633884 0.5081742 0.4969471 0.4527305 0.4332373
## [22] 0.4077015 0.4020697 0.3801634 0.3427602 0.3302359 0.3255505 0.3005628
## [29] 0.2570702 0.2475054
#eigenvalues  = the variance of a component or factor (>1) Kaiser (1960)


#for Extracting the factors
pcf=princomp(std_AEO)
factoextra::get_eigenvalue(pcf)
##        eigenvalue variance.percent cumulative.variance.percent
## Dim.1   6.4935692       17.3162573                    17.31626
## Dim.2   5.2769732       14.0719877                    31.38825
## Dim.3   3.3011752        8.8031708                    40.19142
## Dim.4   3.0632926        8.1688146                    48.36023
## Dim.5   1.6803381        4.4809206                    52.84115
## Dim.6   1.4822533        3.9526921                    56.79384
## Dim.7   1.3354577        3.5612356                    60.35508
## Dim.8   1.2901079        3.4403021                    63.79538
## Dim.9   1.0359151        2.7624520                    66.55783
## Dim.10  0.9899518        2.6398825                    69.19772
## Dim.11  0.9338883        2.4903794                    71.68809
## Dim.12  0.8798536        2.3462861                    74.03438
## Dim.13  0.8342527        2.2246832                    76.25906
## Dim.14  0.8118244        2.1648741                    78.42394
## Dim.15  0.7994347        2.1318347                    80.55577
## Dim.16  0.7271965        1.9391988                    82.49497
## Dim.17  0.6872631        1.8327092                    84.32768
## Dim.18  0.6750484        1.8001366                    86.12782
## Dim.19  0.5851450        1.5603932                    87.68821
## Dim.20  0.5618526        1.4982798                    89.18649
## Dim.21  0.5188680        1.3836539                    90.57014
## Dim.22  0.5124710        1.3665950                    91.93674
## Dim.23  0.4712769        1.2567437                    93.19348
## Dim.24  0.4589876        1.2239722                    94.41746
## Dim.25  0.4166374        1.1110377                    95.52849
## Dim.26  0.4026666        1.0737821                    96.60228
## Dim.27  0.3539550        0.9438840                    97.54616
## Dim.28  0.3373023        0.8994765                    98.44564
## Dim.29  0.3041572        0.8110892                    99.25672
## Dim.30  0.2787271        0.7432753                   100.00000

cat("\n *********** PCA: Above the level of 0.3 ************ \n")
## 
##  *********** PCA: Above the level of 0.3 ************
psych::print.psych(pca, cut = 0.3, sort = TRUE)
## Principal Components Analysis
## Call: principal(r = std_AEO, nfactors = length(std_AEO), rotate = "none")
## Standardized loadings (pattern matrix) based upon correlation matrix
##     item   PC1   PC2   PC3   PC4   PC5   PC6   PC7   PC8   PC9  PC10  PC11
## A2     2  0.72                                                            
## A5     5  0.66                                           -0.33            
## A6     6  0.65                                                            
## E1    11  0.64              0.45                                          
## E5    15  0.63                   -0.33                                    
## A1     1  0.62             -0.36                                          
## A3     3  0.54             -0.42                                          
## A4     4  0.54                                                       -0.34
## E3    13  0.51  0.38             -0.51                                    
## A7     7  0.49                         -0.35              0.34        0.40
## A9     9 -0.47        0.43                                                
## O8    28        0.75                                                      
## O9    29        0.71                                                      
## O7    27        0.67                    0.33                              
## O6    26        0.59                                                      
## O2    22  0.36 -0.58                    0.39                              
## O10   30        0.57  0.34                                                
## O3    23  0.34 -0.40  0.38                                                
## O1    21              0.57             -0.42                              
## O4    24       -0.47  0.51                                                
## O5    25  0.31 -0.40  0.50                                                
## A8     8              0.44              0.31              0.34 -0.40      
## E2    12  0.55              0.65                                          
## E4    14  0.54              0.60                                          
## E8    18 -0.36        0.46 -0.54                                          
## E7    17              0.35        0.63                                    
## E10   20                   -0.31        0.32  0.60              0.37      
## E9    19              0.39                    0.42             -0.37 -0.34
## E6    16  0.38  0.33        0.37                   -0.48                  
## A10   10              0.41  0.39                         -0.43            
##      PC12  PC13  PC14  PC15  PC16  PC17  PC18  PC19  PC20  PC21  PC22  PC23
## A2                                -0.31                                    
## A5                                                                         
## A6                                                                         
## E1                                                                         
## E5                                                                         
## A1   0.33                                                                  
## A3                                                                         
## A4                                                                         
## E3                                                                         
## A7                                                                         
## A9                                                                         
## O8                                                                         
## O9                                                                         
## O7                                                                         
## O6                                                                         
## O2                                                                         
## O10                                                                        
## O3         0.31                                                            
## O1        -0.38        0.34                                                
## O4                                                                         
## O5  -0.34                                                                  
## A8                                                                         
## E2                                                                         
## E4                                                                         
## E8                                                                         
## E7                                                                         
## E10                                                                        
## E9                                                                         
## E6                                                                         
## A10  0.32        0.31                                                      
##      PC24  PC25  PC26  PC27  PC28  PC29  PC30 h2       u2  com
## A2                                             1 -2.9e-15  3.5
## A5                                             1 -1.8e-15  4.6
## A6                                             1 -4.4e-16  5.0
## E1                                             1 -2.2e-16  4.5
## E5                                             1  0.0e+00  5.3
## A1                                             1 -4.4e-16  5.2
## A3                                             1 -2.2e-15  7.1
## A4                                             1 -1.6e-15  7.8
## E3                                             1  1.2e-15  6.0
## A7                                             1  3.3e-16  8.0
## A9                                             1  1.1e-16  8.9
## O8                                             1  1.1e-16  3.0
## O9                                             1  1.4e-15  3.6
## O7                                             1  1.1e-16  4.5
## O6                                             1  1.1e-16  6.5
## O2                                             1  1.1e-15  6.0
## O10                                            1  1.1e-16  6.9
## O3                                             1  3.3e-16 11.7
## O1                                             1  1.3e-15  5.6
## O4                                             1  1.1e-15  7.2
## O5                                             1  3.3e-16  7.8
## A8                                             1  2.2e-15  9.7
## E2                                             1 -6.7e-16  3.6
## E4                                             1 -4.4e-16  4.4
## E8                                             1 -8.9e-16  6.4
## E7                                             1  1.4e-15  5.3
## E10                                            1 -6.7e-16  5.5
## E9                                             1 -2.2e-16  9.2
## E6                                             1  0.0e+00  8.6
## A10                                            1  4.4e-16  8.6
## 
##                        PC1  PC2  PC3  PC4  PC5  PC6  PC7  PC8  PC9 PC10 PC11
## SS loadings           5.44 3.58 2.59 2.45 1.36 1.21 0.99 0.92 0.87 0.83 0.82
## Proportion Var        0.18 0.12 0.09 0.08 0.05 0.04 0.03 0.03 0.03 0.03 0.03
## Cumulative Var        0.18 0.30 0.39 0.47 0.51 0.55 0.59 0.62 0.65 0.68 0.70
## Proportion Explained  0.18 0.12 0.09 0.08 0.05 0.04 0.03 0.03 0.03 0.03 0.03
## Cumulative Proportion 0.18 0.30 0.39 0.47 0.51 0.55 0.59 0.62 0.65 0.68 0.70
##                       PC12 PC13 PC14 PC15 PC16 PC17 PC18 PC19 PC20 PC21 PC22
## SS loadings           0.80 0.73 0.70 0.64 0.60 0.56 0.51 0.50 0.45 0.43 0.41
## Proportion Var        0.03 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.01 0.01
## Cumulative Var        0.73 0.75 0.78 0.80 0.82 0.84 0.85 0.87 0.89 0.90 0.91
## Proportion Explained  0.03 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.02 0.01 0.01
## Cumulative Proportion 0.73 0.75 0.78 0.80 0.82 0.84 0.85 0.87 0.89 0.90 0.91
##                       PC23 PC24 PC25 PC26 PC27 PC28 PC29 PC30
## SS loadings           0.40 0.38 0.34 0.33 0.33 0.30 0.26 0.25
## Proportion Var        0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01
## Cumulative Var        0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00
## Proportion Explained  0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01
## Cumulative Proportion 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00
## 
## Mean item complexity =  6.3
## Test of the hypothesis that 30 components are sufficient.
## 
## The root mean square of the residuals (RMSR) is  0 
##  with the empirical chi square  0  with prob <  NA 
## 
## Fit based upon off diagonal values = 1
#create a diagram showing the components and how the manifest variables load
fa.diagram(pca) 

cat("\n *********** Variables on to components ************ \n")
## 
##  *********** Variables on to components ************
fa.sort(pca$loading)
## 
## Loadings:
##     PC1    PC2    PC3    PC4    PC5    PC6    PC7    PC8    PC9    PC10  
## A2   0.718  0.145  0.131         0.140                                   
## A5   0.658        -0.115 -0.106         0.123               -0.327 -0.156
## A6   0.648         0.177 -0.245         0.266         0.225 -0.101       
## E1   0.642                0.445         0.101  0.177 -0.120         0.102
## E5   0.630  0.260  0.183        -0.330  0.134 -0.104 -0.138         0.169
## A1   0.622               -0.364  0.139                                   
## A3   0.544  0.107  0.143 -0.420  0.225                             -0.243
## A4   0.542  0.164        -0.286  0.119 -0.130 -0.290  0.282         0.163
## E3   0.514  0.384  0.142        -0.506                                   
## A7   0.493        -0.126 -0.256  0.160 -0.352        -0.142  0.345       
## A9  -0.466         0.428  0.289         0.110        -0.266  0.132  0.279
## O8  -0.175  0.749  0.258                                                 
## O9          0.709  0.222                       0.206  0.121              
## O7          0.666  0.143         0.274  0.334                      -0.154
## O6  -0.124  0.589  0.181         0.283  0.175 -0.287 -0.130  0.283  0.138
## O2   0.360 -0.579  0.138  0.167  0.182  0.390                0.131       
## O10 -0.136  0.569  0.339        -0.163 -0.257         0.167              
## O3   0.338 -0.397  0.376 -0.116 -0.278 -0.215 -0.145  0.151  0.246       
## O1   0.128 -0.199  0.571               -0.421                            
## O4   0.226 -0.473  0.510               -0.101        -0.293 -0.158       
## O5   0.311 -0.405  0.505                                    -0.109 -0.123
## A8  -0.224         0.438  0.294 -0.187  0.306 -0.216  0.114  0.340 -0.395
## E2   0.550                0.648                       0.125  0.110       
## E4   0.545                0.598                       0.167              
## E8  -0.361         0.459 -0.537                      -0.199              
## E7  -0.268 -0.246  0.350  0.114  0.625        -0.144        -0.105  0.252
## E10 -0.102         0.295 -0.312         0.318  0.597  0.211  0.135  0.371
## E9  -0.203         0.388  0.130  0.285 -0.294  0.417  0.174        -0.365
## E6   0.379  0.332  0.153  0.370        -0.129  0.182 -0.478 -0.146       
## A10 -0.186         0.411  0.394 -0.105                0.264 -0.429       
##     PC11   PC12   PC13   PC14   PC15   PC16   PC17   PC18   PC19   PC20  
## A2                 0.123  0.217               -0.309  0.109 -0.267       
## A5         -0.210  0.259 -0.229  0.217                0.171         0.283
## A6   0.184         0.172 -0.142               -0.129 -0.139 -0.209       
## E1                       -0.140         0.216        -0.209  0.149       
## E5  -0.227         0.164 -0.116                                    -0.235
## A1          0.332 -0.142 -0.166  0.108 -0.163  0.264                     
## A3   0.196  0.286 -0.199               -0.172                      -0.154
## A4  -0.337        -0.187  0.208 -0.119  0.136  0.116                     
## E3  -0.157        -0.119  0.192  0.114                              0.107
## A7   0.395         0.154  0.117  0.109  0.230                0.186  0.109
## A9   0.114  0.215  0.167               -0.191               -0.164  0.252
## O8         -0.212  0.123        -0.127        -0.119         0.148       
## O9         -0.110 -0.122 -0.102 -0.293 -0.283        -0.225         0.181
## O7         -0.100         0.165         0.175  0.165  0.109 -0.161  0.154
## O6         -0.153         0.134  0.229 -0.200                0.156 -0.147
## O2                                                   -0.293              
## O10  0.175  0.104  0.103 -0.244         0.267  0.281 -0.114 -0.174       
## O3  -0.126  0.100  0.306        -0.214 -0.153         0.152              
## O1         -0.204 -0.378 -0.110  0.343        -0.217                0.121
## O4   0.125 -0.234 -0.105               -0.151  0.158  0.101 -0.138 -0.195
## O5   0.148 -0.336         0.176 -0.217  0.113  0.215         0.204       
## A8                -0.123 -0.249         0.150 -0.134  0.182              
## E2                                                                       
## E4   0.213                                     0.110                     
## E8  -0.107  0.151         0.210         0.189 -0.136 -0.160              
## E7  -0.119  0.133        -0.180         0.124 -0.163         0.163       
## E10               -0.181                              0.254              
## E9  -0.344         0.264         0.181         0.125                     
## E6  -0.155  0.171               -0.223  0.118         0.213              
## A10  0.222  0.318         0.305  0.168                       0.194       
##     PC21   PC22   PC23   PC24   PC25   PC26   PC27   PC28   PC29   PC30  
## A2   0.175  0.133        -0.205               -0.181 -0.107              
## A5          0.159                              0.100                0.133
## A6  -0.280 -0.123         0.105         0.171  0.140                     
## E1                -0.193  0.101  0.273               -0.195              
## E5         -0.222                                     0.134  0.233       
## A1                 0.121 -0.180         0.221 -0.140                     
## A3                -0.191               -0.232         0.161              
## A4   0.131        -0.240  0.122                0.131                     
## E3                 0.220                       0.205        -0.101 -0.211
## A7         -0.134               -0.102                                   
## A9                -0.236                       0.103                     
## O8   0.246                              0.179         0.173 -0.229       
## O9                                                   -0.152  0.173       
## O7  -0.119 -0.219                0.109 -0.182 -0.124                     
## O6  -0.127  0.248                                    -0.122              
## O2   0.120         0.104  0.158 -0.238        -0.181  0.105              
## O10         0.234                                                        
## O3  -0.164                0.154  0.109 -0.118 -0.129                     
## O1  -0.135                                    -0.128                     
## O4   0.218         0.138  0.213                      -0.110              
## O5  -0.105        -0.110 -0.281                                          
## A8                                                   -0.101              
## E2         -0.143  0.133 -0.221        -0.101  0.148        -0.132  0.272
## E4          0.121                0.195  0.180         0.246  0.195       
## E8                 0.100         0.249  0.107                       0.192
## E7                 0.189                       0.122               -0.143
## E10                                                                      
## E9                                                                       
## E6  -0.217                      -0.184  0.110                            
## A10                                                                      
## 
##                  PC1   PC2   PC3   PC4   PC5   PC6   PC7   PC8   PC9  PC10
## SS loadings    5.442 3.585 2.592 2.452 1.359 1.211 0.991 0.923 0.867 0.834
## Proportion Var 0.181 0.119 0.086 0.082 0.045 0.040 0.033 0.031 0.029 0.028
## Cumulative Var 0.181 0.301 0.387 0.469 0.514 0.555 0.588 0.618 0.647 0.675
##                 PC11  PC12  PC13  PC14  PC15  PC16  PC17  PC18  PC19  PC20
## SS loadings    0.823 0.804 0.734 0.695 0.635 0.605 0.563 0.508 0.497 0.453
## Proportion Var 0.027 0.027 0.024 0.023 0.021 0.020 0.019 0.017 0.017 0.015
## Cumulative Var 0.703 0.729 0.754 0.777 0.798 0.818 0.837 0.854 0.871 0.886
##                 PC21  PC22  PC23  PC24  PC25  PC26  PC27  PC28  PC29  PC30
## SS loadings    0.433 0.408 0.402 0.380 0.343 0.330 0.326 0.301 0.257 0.248
## Proportion Var 0.014 0.014 0.013 0.013 0.011 0.011 0.011 0.010 0.009 0.008
## Cumulative Var 0.900 0.914 0.927 0.940 0.951 0.962 0.973 0.983 0.992 1.000
# The communalities of variables across components (will be one for PCA since all the variance is used)
# In the initial PCA because we have as many components/factors as manifest variables this will be 1
pca$communality 
##  A1  A2  A3  A4  A5  A6  A7  A8  A9 A10  E1  E2  E3  E4  E5  E6  E7  E8  E9 E10 
##   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1 
##  O1  O2  O3  O4  O5  O6  O7  O8  O9 O10 
##   1   1   1   1   1   1   1   1   1   1
#Visualize contribution of variables to each component
var <- factoextra::get_pca_var(pcf)
corrplot::corrplot(var$contrib, is.corr=FALSE)

# Contributions of variables to PC1
factoextra::fviz_contrib(pcf, choice = "var", axes = 1, top = 10)

# Contributions of variables to PC2
factoextra::fviz_contrib(pcf, choice = "var", axes = 2, top = 10)

# Contributions of variables to PC3
factoextra::fviz_contrib(pcf, choice = "var", axes = 3, top = 10)

## Step 5: Apply rotation The aim of rotation is to clarify the data structure. The factor patterns define decreasing amounts of variation in the data. Each pattern may involve all or most of the variables and the variables may have moderate or high loadings for several factor patterns. Geometric Rotation

#Apply rotation to try to refine the component structure
pc_rotat <-  principal(std_AEO, nfactors = 3, rotate = "varimax") #Extracting 3 factors

cat("\n\n ****************** Output the components **************** \n")
## 
## 
##  ****************** Output the components ****************
psych::print.psych(pc_rotat, cut = 0.3, sort = TRUE)
## Principal Components Analysis
## Call: principal(r = std_AEO, nfactors = 3, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
##     item   RC1   RC2   RC3   h2   u2 com
## A2     2  0.74             0.55 0.45 1.0
## E5    15  0.69             0.50 0.50 1.1
## A6     6  0.66             0.45 0.55 1.1
## A1     1  0.63             0.40 0.60 1.0
## A5     5  0.63             0.45 0.55 1.3
## E1    11  0.61             0.41 0.59 1.2
## E3    13  0.59             0.43 0.57 1.5
## A3     3  0.57             0.33 0.67 1.0
## A4     4  0.55             0.32 0.68 1.2
## E2    12  0.54             0.30 0.70 1.1
## E4    14  0.53             0.31 0.69 1.2
## A7     7  0.46             0.26 0.74 1.4
## E6    16  0.45             0.28 0.72 1.6
## O8    28        0.81       0.66 0.34 1.0
## O9    29        0.74       0.56 0.44 1.0
## O7    27        0.68       0.47 0.53 1.0
## O10   30        0.65       0.46 0.54 1.2
## O6    26        0.63       0.39 0.61 1.0
## O2    22       -0.59       0.48 0.52 1.8
## O1    21              0.58 0.38 0.62 1.3
## O4    24       -0.38  0.58 0.53 0.47 2.1
## O5    25  0.32 -0.34  0.55 0.52 0.48 2.4
## E8    18              0.48 0.34 0.66 1.9
## A9     9 -0.37        0.47 0.40 0.60 2.3
## A8     8              0.47 0.25 0.75 1.3
## E7    17              0.43 0.26 0.74 1.7
## E9    19              0.42 0.20 0.80 1.3
## O3    23  0.33 -0.36  0.42 0.41 0.59 2.9
## A10   10              0.39 0.21 0.79 1.7
## E10   20              0.31 0.10 0.90 1.1
## 
##                        RC1  RC2  RC3
## SS loadings           5.30 3.61 2.71
## Proportion Var        0.18 0.12 0.09
## Cumulative Var        0.18 0.30 0.39
## Proportion Explained  0.46 0.31 0.23
## Cumulative Proportion 0.46 0.77 1.00
## 
## Mean item complexity =  1.4
## Test of the hypothesis that 3 components are sufficient.
## 
## The root mean square of the residuals (RMSR) is  0.08 
##  with the empirical chi square  2387.19  with prob <  2.7e-300 
## 
## Fit based upon off diagonal values = 0.83
cat("\n\n ****************** Output the communalities **************** \n")
## 
## 
##  ****************** Output the communalities ****************
pc_rotat$communality
##        A1        A2        A3        A4        A5        A6        A7        A8 
## 0.3965544 0.5541820 0.3276494 0.3221578 0.4486197 0.4517483 0.2610561 0.2479507 
##        A9       A10        E1        E2        E3        E4        E5        E6 
## 0.4006096 0.2131236 0.4132195 0.3028360 0.4316967 0.3111398 0.4974551 0.2775750 
##        E7        E8        E9       E10        O1        O2        O3        O4 
## 0.2555838 0.3405504 0.1986758 0.1021134 0.3816605 0.4839259 0.4132861 0.5341659 
##        O5        O6        O7        O8        O9       O10 
## 0.5151607 0.3946487 0.4673077 0.6582340 0.5581462 0.4572746

Step 6: Dimension reduction and Decide which factores/compenents to retain

#Factor Analysis - the default here is principal axis factoring fm=pa
#If we know our data going in is normally distributed we use maximum likelihood
facsol <- psych::fa(perstdMatrix_AEO, nfactors=3, obs=NA, n.iter=1, rotate="varimax", fm="pa")

plot(facsol$values, type = "b") #scree plot

cat("\n *** the Variance accounted for each factor/component *** \n")
## 
##  *** the Variance accounted for each factor/component ***
facsol$Vaccounted #(3 factors)
##                             PA1       PA2        PA3
## SS loadings           4.6114062 3.0648476 2.03807042
## Proportion Var        0.1537135 0.1021616 0.06793568
## Cumulative Var        0.1537135 0.2558751 0.32381081
## Proportion Explained  0.4747017 0.3154978 0.20980053
## Cumulative Proportion 0.4747017 0.7901995 1.00000000
cat("\n\n ******* Output the Eigenvalues ******* \n")
## 
## 
##  ******* Output the Eigenvalues *******
facsol$values 
##  [1]  4.80707315  3.00062414  1.90662696  1.74086885  0.65994818  0.49529984
##  [7]  0.23427859  0.21763862  0.19986766  0.12553273  0.09895981  0.08148037
## [13]  0.02936610  0.00574592 -0.02519957 -0.05011261 -0.10392919 -0.14227435
## [19] -0.17595295 -0.19383450 -0.19650206 -0.22449309 -0.26887744 -0.29953683
## [25] -0.30854426 -0.32222712 -0.34825614 -0.35616921 -0.41605302 -0.45632223
cat("\n\n ******* the components with loadings ******* \n")
## 
## 
##  ******* the components with loadings *******
psych::print.psych(facsol,cut=0.3, sort=TRUE)
## Factor Analysis using method =  pa
## Call: psych::fa(r = perstdMatrix_AEO, nfactors = 3, n.iter = 1, rotate = "varimax", 
##     fm = "pa", obs = NA)
## Standardized loadings (pattern matrix) based upon correlation matrix
##     item   PA1   PA2   PA3    h2   u2 com
## A2     2  0.72             0.522 0.48 1.0
## E5    15  0.66             0.450 0.55 1.1
## A6     6  0.64             0.428 0.57 1.1
## A1     1  0.60             0.369 0.63 1.0
## A5     5  0.59             0.394 0.61 1.3
## A3     3  0.55             0.313 0.69 1.1
## E1    11  0.55             0.396 0.60 1.6
## E3    13  0.55             0.360 0.64 1.4
## A4     4  0.51             0.270 0.73 1.1
## E2    12  0.46             0.296 0.70 1.8
## E4    14  0.45       -0.33 0.322 0.68 1.9
## A7     7  0.43             0.202 0.80 1.2
## E6    16  0.39             0.202 0.80 1.7
## A9     9 -0.35        0.33 0.251 0.75 2.4
## O8    28        0.78       0.616 0.38 1.0
## O9    29        0.69       0.482 0.52 1.0
## O7    27        0.60       0.374 0.63 1.0
## O10   30        0.58       0.367 0.63 1.2
## O2    22       -0.56       0.398 0.60 1.5
## O6    26        0.55       0.303 0.70 1.0
## E8    18              0.58 0.425 0.58 1.5
## O5    25  0.31 -0.33  0.48 0.438 0.56 2.6
## O4    24       -0.37  0.48 0.416 0.58 2.3
## O1    21              0.45 0.248 0.75 1.4
## O3    23  0.31 -0.34  0.36 0.342 0.66 3.0
## E7    17              0.32 0.156 0.84 2.0
## E10   20              0.30 0.094 0.91 1.0
## A8     8                   0.107 0.89 1.5
## E9    19                   0.100 0.90 1.4
## A10   10                   0.074 0.93 2.3
## 
##                        PA1  PA2  PA3
## SS loadings           4.61 3.06 2.04
## Proportion Var        0.15 0.10 0.07
## Cumulative Var        0.15 0.26 0.32
## Proportion Explained  0.47 0.32 0.21
## Cumulative Proportion 0.47 0.79 1.00
## 
## Mean item complexity =  1.5
## Test of the hypothesis that 3 factors are sufficient.
## 
## The degrees of freedom for the null model are  435  and the objective function was  10.75
## The degrees of freedom for the model are 348  and the objective function was  3.83 
## 
## The root mean square of the residuals (RMSR) is  0.08 
## The df corrected root mean square of the residuals is  0.09 
## 
## Fit based upon off diagonal values = 0.86
## Measures of factor score adequacy             
##                                                    PA1  PA2  PA3
## Correlation of (regression) scores with factors   0.94 0.92 0.87
## Multiple R square of scores with factors          0.88 0.85 0.75
## Minimum correlation of possible factor scores     0.76 0.69 0.50
cat("\n\n *******  sorted list of loadings ******* \n")
## 
## 
##  *******  sorted list of loadings *******
fa.sort(facsol$loading)
## 
## Loadings:
##     PA1    PA2    PA3   
## A2   0.722              
## E5   0.659  0.125       
## A6   0.643              
## A1   0.604              
## A5   0.590 -0.111 -0.186
## A3   0.549         0.102
## E1   0.549 -0.181 -0.249
## E3   0.547  0.234       
## A4   0.512              
## E2   0.457 -0.139 -0.260
## E4   0.454        -0.328
## A7   0.427        -0.120
## E6   0.389  0.196 -0.108
## A9  -0.350  0.151  0.326
## O8          0.781       
## O9          0.687       
## O7          0.605       
## O10         0.577  0.179
## O2   0.246 -0.564  0.138
## O6          0.549       
## E8  -0.211  0.196  0.585
## O5   0.315 -0.328  0.481
## O4   0.218 -0.371  0.480
## O1   0.179         0.455
## O3   0.312 -0.340  0.359
## E7  -0.218         0.316
## E10                0.304
## A8  -0.146         0.290
## E9  -0.130         0.286
## A10         0.154  0.204
## 
##                  PA1   PA2   PA3
## SS loadings    4.611 3.065 2.038
## Proportion Var 0.154 0.102 0.068
## Cumulative Var 0.154 0.256 0.324
#create a diagram showing the factors and how the manifest variables load
fa.diagram(facsol)

## Step 7: Rotation for 3 factors

#Apply rotation to try to refine the component structure
facsolrot <-  principal(perstdMatrix_AEO, rotate = "varimax")

cat("\n\n ******* Output the components ******* \n")
## 
## 
##  ******* Output the components *******
psych::print.psych(facsolrot, cut = 0.3, sort = TRUE)
## Principal Components Analysis
## Call: principal(r = perstdMatrix_AEO, rotate = "varimax")
## Standardized loadings (pattern matrix) based upon correlation matrix
##      V   PC1     h2   u2 com
## A2   2  0.72 0.5158 0.48   1
## A5   5  0.66 0.4327 0.57   1
## A6   6  0.65 0.4200 0.58   1
## E1  11  0.64 0.4120 0.59   1
## E5  15  0.63 0.3967 0.60   1
## A1   1  0.62 0.3867 0.61   1
## E2  12  0.55 0.3026 0.70   1
## E4  14  0.54 0.2968 0.70   1
## A3   3  0.54 0.2957 0.70   1
## A4   4  0.54 0.2934 0.71   1
## E3  13  0.51 0.2644 0.74   1
## A7   7  0.49 0.2429 0.76   1
## A9   9 -0.47 0.2172 0.78   1
## E6  16  0.38 0.1436 0.86   1
## E8  18 -0.36 0.1302 0.87   1
## O2  22  0.36 0.1299 0.87   1
## O3  23  0.34 0.1146 0.89   1
## O5  25  0.31 0.0966 0.90   1
## E7  17       0.0720 0.93   1
## O4  24       0.0509 0.95   1
## A8   8       0.0502 0.95   1
## E9  19       0.0413 0.96   1
## A10 10       0.0348 0.97   1
## O8  28       0.0305 0.97   1
## O10 30       0.0186 0.98   1
## O1  21       0.0163 0.98   1
## O6  26       0.0154 0.98   1
## E10 20       0.0104 0.99   1
## O9  29       0.0061 0.99   1
## O7  27       0.0034 1.00   1
## 
##                 PC1
## SS loadings    5.44
## Proportion Var 0.18
## 
## Mean item complexity =  1
## Test of the hypothesis that 1 component is sufficient.
## 
## The root mean square of the residuals (RMSR) is  0.14 
## 
## Fit based upon off diagonal values = 0.55
cat("\n\n ******* Output the communalities ******* \n")
## 
## 
##  ******* Output the communalities *******
facsolrot$communality
##          A1          A2          A3          A4          A5          A6 
## 0.386687010 0.515847746 0.295663588 0.293371005 0.432702074 0.419993950 
##          A7          A8          A9         A10          E1          E2 
## 0.242941300 0.050193955 0.217242280 0.034755901 0.412047325 0.302635971 
##          E3          E4          E5          E6          E7          E8 
## 0.264411435 0.296835660 0.396683708 0.143623073 0.072029014 0.130219036 
##          E9         E10          O1          O2          O3          O4 
## 0.041313525 0.010434195 0.016308453 0.129850178 0.114569834 0.050888852 
##          O5          O6          O7          O8          O9         O10 
## 0.096634425 0.015381110 0.003390273 0.030487130 0.006130375 0.018626437

Step 8: Reliability Analysis

## Warning in psych::alpha(agree_a, check.keys = TRUE): Some items were negatively correlated with total scale and were automatically reversed.
##  This is indicated by a negative sign for the variable name.
## 
## Reliability analysis   
## Call: psych::alpha(x = agree_a, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##        0.8      0.81    0.82       0.3 4.2 0.015  3.4 0.61     0.28
## 
##  lower alpha upper     95% confidence boundaries
## 0.78 0.8 0.83 
## 
##  Reliability if an item is dropped:
##      raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## A1        0.77      0.78    0.78      0.28 3.6    0.017 0.012  0.28
## A2        0.78      0.78    0.79      0.29 3.6    0.017 0.012  0.28
## A3        0.78      0.78    0.79      0.29 3.6    0.017 0.012  0.28
## A4        0.78      0.79    0.79      0.29 3.7    0.017 0.016  0.28
## A5        0.78      0.79    0.79      0.29 3.7    0.017 0.015  0.28
## A6        0.78      0.79    0.79      0.29 3.7    0.017 0.011  0.28
## A7        0.79      0.79    0.80      0.30 3.8    0.016 0.017  0.30
## A8-       0.81      0.81    0.81      0.32 4.3    0.015 0.013  0.31
## A9-       0.79      0.79    0.80      0.30 3.8    0.016 0.017  0.28
## A10-      0.81      0.81    0.82      0.33 4.4    0.015 0.011  0.31
## 
##  Item statistics 
##        n raw.r std.r r.cor r.drop mean   sd
## A1   382  0.70  0.69  0.66   0.59  3.7 1.13
## A2   382  0.66  0.67  0.63   0.55  3.9 1.00
## A3   382  0.67  0.66  0.63   0.55  3.8 1.08
## A4   382  0.64  0.63  0.58   0.52  3.8 1.02
## A5   382  0.63  0.64  0.59   0.53  3.9 0.87
## A6   382  0.63  0.64  0.60   0.53  3.7 0.92
## A7   382  0.59  0.61  0.54   0.49  3.9 0.87
## A8-  382  0.49  0.47  0.36   0.32  2.0 1.16
## A9-  382  0.62  0.62  0.56   0.50  3.0 0.98
## A10- 382  0.43  0.43  0.32   0.28  2.6 1.05
## 
## Non missing response frequency for each item
##        0    1    2    3    4    5 miss
## A1  0.01 0.03 0.12 0.14 0.47 0.23    0
## A2  0.01 0.02 0.06 0.18 0.48 0.26    0
## A3  0.01 0.03 0.08 0.15 0.47 0.25    0
## A4  0.01 0.02 0.08 0.17 0.51 0.20    0
## A5  0.00 0.01 0.05 0.17 0.52 0.25    0
## A6  0.01 0.02 0.05 0.25 0.49 0.18    0
## A7  0.00 0.01 0.07 0.10 0.59 0.22    0
## A8  0.01 0.07 0.30 0.26 0.25 0.10    0
## A9  0.02 0.31 0.43 0.15 0.08 0.01    0
## A10 0.01 0.17 0.43 0.21 0.15 0.03    0
## Warning in psych::alpha(extra_e, check.keys = TRUE): Some items were negatively correlated with total scale and were automatically reversed.
##  This is indicated by a negative sign for the variable name.
## 
## Reliability analysis   
## Call: psych::alpha(x = extra_e, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.76      0.75    0.79      0.23 3.1 0.018  2.9 0.65      0.2
## 
##  lower alpha upper     95% confidence boundaries
## 0.72 0.76 0.79 
## 
##  Reliability if an item is dropped:
##      raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## E1        0.71      0.71    0.75      0.21 2.4    0.022 0.030  0.20
## E2        0.71      0.71    0.75      0.21 2.4    0.022 0.025  0.17
## E3        0.74      0.73    0.76      0.23 2.6    0.020 0.033  0.20
## E4        0.71      0.71    0.75      0.21 2.4    0.022 0.028  0.17
## E5        0.74      0.73    0.77      0.23 2.7    0.019 0.035  0.18
## E6        0.74      0.74    0.78      0.24 2.8    0.019 0.035  0.20
## E7-       0.76      0.75    0.79      0.25 3.1    0.018 0.035  0.24
## E8-       0.73      0.73    0.76      0.23 2.7    0.020 0.032  0.21
## E9-       0.77      0.77    0.80      0.27 3.3    0.017 0.033  0.27
## E10-      0.77      0.76    0.80      0.26 3.2    0.017 0.034  0.27
## 
##  Item statistics 
##        n raw.r std.r r.cor r.drop mean   sd
## E1   382  0.71  0.70  0.67   0.60  2.6 1.17
## E2   382  0.73  0.70  0.70   0.61  2.9 1.33
## E3   382  0.58  0.61  0.57   0.46  3.9 1.04
## E4   382  0.74  0.71  0.70   0.63  2.7 1.25
## E5   382  0.55  0.58  0.53   0.43  3.9 0.95
## E6   382  0.57  0.55  0.47   0.41  2.8 1.30
## E7-  382  0.41  0.43  0.34   0.25  2.9 1.11
## E8-  382  0.62  0.59  0.55   0.48  1.9 1.25
## E9-  382  0.30  0.34  0.21   0.16  3.0 1.01
## E10- 382  0.38  0.37  0.23   0.21  2.7 1.17
## 
## Non missing response frequency for each item
##        0    1    2    3    4    5 miss
## E1  0.01 0.20 0.31 0.27 0.15 0.06    0
## E2  0.01 0.16 0.23 0.19 0.28 0.13    0
## E3  0.01 0.02 0.07 0.15 0.45 0.31    0
## E4  0.01 0.20 0.27 0.21 0.24 0.07    0
## E5  0.02 0.01 0.04 0.13 0.54 0.25    0
## E6  0.01 0.16 0.29 0.20 0.22 0.12    0
## E7  0.01 0.35 0.37 0.12 0.12 0.03    0
## E8  0.01 0.08 0.28 0.22 0.25 0.16    0
## E9  0.01 0.29 0.46 0.14 0.07 0.03    0
## E10 0.01 0.27 0.39 0.15 0.12 0.05    0
## Warning in psych::alpha(open_o, check.keys = TRUE): Some items were negatively correlated with total scale and were automatically reversed.
##  This is indicated by a negative sign for the variable name.
## 
## Reliability analysis   
## Call: psych::alpha(x = open_o, check.keys = TRUE)
## 
##   raw_alpha std.alpha G6(smc) average_r S/N   ase mean   sd median_r
##       0.79      0.78    0.81      0.27 3.6 0.016  2.3 0.69     0.26
## 
##  lower alpha upper     95% confidence boundaries
## 0.76 0.79 0.82 
## 
##  Reliability if an item is dropped:
##     raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## O1-      0.80      0.79    0.81      0.30 3.9    0.015 0.018  0.27
## O2-      0.76      0.76    0.79      0.26 3.1    0.018 0.026  0.23
## O3-      0.77      0.77    0.80      0.27 3.3    0.017 0.027  0.25
## O4-      0.77      0.76    0.78      0.26 3.2    0.017 0.026  0.26
## O5-      0.77      0.77    0.79      0.27 3.3    0.017 0.025  0.26
## O6       0.77      0.77    0.79      0.27 3.3    0.018 0.025  0.27
## O7       0.76      0.76    0.78      0.26 3.1    0.018 0.025  0.25
## O8       0.75      0.75    0.77      0.25 3.0    0.019 0.020  0.25
## O9       0.76      0.76    0.78      0.26 3.1    0.018 0.022  0.25
## O10      0.78      0.77    0.80      0.28 3.4    0.017 0.021  0.25
## 
##  Item statistics 
##       n raw.r std.r r.cor r.drop mean   sd
## O1- 382  0.35  0.38  0.27   0.20  1.4 1.08
## O2- 382  0.64  0.64  0.58   0.52  2.2 1.21
## O3- 382  0.54  0.57  0.49   0.42  1.4 1.02
## O4- 382  0.59  0.61  0.56   0.46  1.5 1.12
## O5- 382  0.53  0.57  0.51   0.42  1.4 0.99
## O6  382  0.60  0.58  0.51   0.46  3.0 1.25
## O7  382  0.65  0.64  0.59   0.53  2.9 1.20
## O8  382  0.73  0.70  0.69   0.62  3.1 1.35
## O9  382  0.66  0.63  0.59   0.53  3.1 1.30
## O10 382  0.54  0.52  0.45   0.40  3.5 1.17
## 
## Non missing response frequency for each item
##        0    1    2    3    4    5 miss
## O1  0.02 0.01 0.14 0.18 0.47 0.19    0
## O2  0.01 0.15 0.30 0.21 0.25 0.07    0
## O3  0.01 0.03 0.10 0.20 0.52 0.13    0
## O4  0.01 0.04 0.15 0.26 0.37 0.18    0
## O5  0.01 0.02 0.10 0.25 0.46 0.15    0
## O6  0.02 0.11 0.27 0.19 0.31 0.10    0
## O7  0.01 0.12 0.33 0.18 0.29 0.07    0
## O8  0.01 0.13 0.21 0.16 0.31 0.17    0
## O9  0.01 0.12 0.25 0.15 0.34 0.13    0
## O10 0.01 0.05 0.16 0.14 0.47 0.17    0
report: A,E,O three Types of Items
  
A principal component analysis (PCA) was conducted on the 30 items with orthogonal rotation (varimax).  Bartlett’s test of sphericity, Χ2(435) = 3978.985, p< .001, indicated that correlations between items were sufficiently large for PCA.  An initial analysis was run to obtain eigenvalues for each component in the data.  Four components had eigenvalues over Kaiser’s criterion of 1 and in combination explained 50.94% of the variance.  The scree plot was slightly ambiguous and showed inflexions that would justify retaining either 3 or 5 factors.  
Given the large sample size, and the convergence of the scree plot and Kaiser’s criterion on three components, three components were retained in the final analysis. component 1 represents agreeableness , component 2 extraversion and component 3 openness.
The aggrement component subscales of the RAQ had high reliability, Cronbach’s α = 0.80; the openess subscales of the RAQ had great reliability, Cronbach’s α = 0.79.  The extraversion of statistics do not achieve a reliability of Cronbach’s α = 0.76, refer to Goldberg LR, Johnson JA, Eber HW, et al (2006) .